aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Make sure to free content dir in procfs"Samuel Thibault2014-12-261-8/+1
| | | | This reverts commit 5fe615a4d66f4dea48812ed9e4f250010a8f9298.
* Make sure to free content dir in procfsLancelot SIX2014-12-261-1/+8
| | | | | In procfs/netfs.c:netfs_get_dirents, make sure to free the memory allocated with the "get_contents" callback of nodes.
* Avoid ./ components in mtab outputSamuel Thibault2014-12-192-4/+4
| | | | | | * libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Match "." path as being the root directory. * libnetfs/dir-lookup.c (netfs_S_dir_lookup): Likewise.
* hurd: make the protected payload changes less intrusiveJustus Winter2014-12-122-3/+3
| | | | | | | | | | The changes to `hurd_types.defs' caused the glibc build to fail. Guard the problematic parts with `HURD_SERVER' similar how it is done in GNU Mach. * Makeconf: Define `HURD_SERVER' when preprocessing the RPC definitions for the server side. * hurd/hurd_types.defs: Guard problematic parts with `HURD_SERVER'.
* Fix inclusion loop between hurd_types.defs and hurd/signal.h>Samuel Thibault2014-12-113-2/+7
| | | | | | * boot/Makefile (MIGSFLAGS): Add -DHURD_DEFAULT_PAYLOAD_TO_PORT=1. * mach-defpager/Makefile (MIGSFLAGS): Likewise. * hurd/hurd_types.defs: Do not include <hurd/ports.h>.
* Replace `bcopy' with `memcpy' or `memmove' as appropriateJustus Winter2014-12-1015-39/+39
| | | | | | | | | | | | | | | | | | | * ext2fs/inode.c: Replace `bcopy' with `memcpy' or `memmove' as appropriate. * ext2fs/pager.c: Likewise. * isofs/lookup.c: Likewise. * isofs/main.c: Likewise. * isofs/rr.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libiohelp/return-buffer.c: Likewise. * libpager/pagemap.c: Likewise. * libpipe/pq.c: Likewise. * libpipe/pq.h: Likewise. * libstore/unzipstore.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/ethernet.c: Likewise. * pfinet/tunnel.c: Likewise. * storeio/dev.c: Likewise.
* Replace `bzero' with `memset'Justus Winter2014-12-1046-79/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For reference, this patch was created using the following semantic patch, and then manually applying the change in all functions containing nested functions, as those are not supported by Coccinelle. @@ expression A, B; @@ - bzero (A, B) + memset (A, 0, B) * auth/auth.c: Replace `bzero' with `memset'. * boot/boot.c: Likewise. * defpager/defpager.c: Likewise. * exec/exec.c: Likewise. Also, drop `safe_bzero' and just use `hurd_safe_memset' directly. * ext2fs/ext2fs.c: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/pager.c: Likewise. * fatfs/pager.c: Likewise. * ftpfs/dir.c: Likewise. * ftpfs/netfs.c: Likewise. * isofs/inode.c: Likewise. * isofs/pager.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-statfs.c: Likewise. * libfshelp/fetch-root.c: Likewise. * libfshelp/start-translator.c: Likewise. * libftpconn/create.c: Likewise. * libftpconn/open.c: Likewise. * libftpconn/unix.c: Likewise. * libpipe/pipe.c: Likewise. * libps/procstat.c: Likewise. * libps/spec.c: Likewise. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/ugids.c: Likewise. * libstore/argp.c: Likewise. * libstore/enc.c: Likewise. * libstore/kids.c: Likewise. * libthreads/alpha/thread.c: Likewise. * libtreefs/fsys.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/glue-include/asm/uaccess.h: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/options.c: Likewise. * pfinet/socket.c: Likewise. * pfinet/timer-emul.c: Likewise. * pflocal/io.c: Likewise. * startup/startup.c: Likewise. * storeio/storeio.c: Likewise. * sutils/fstab.c: Likewise. * usermux/usermux.c: Likewise. * utils/fakeauth.c: Likewise. * utils/frobauth.c: Likewise. * utils/login.c: Likewise. * utils/x.c: Likewise.
* ext2fs: tune the size of the inode cacheJustus Winter2014-12-101-1/+1
| | | | | | | | The node cache uses a fixed number of buckets giving it a linear access complexity, although with a small constant factor. Paper over this issue by increasing the number of buckets. * ext2fs/inode.c (INOHSZ): Increase from 512 to 8192 entries.
* libpager: use libports notification functionsJustus Winter2014-12-105-109/+5
| | | | | | | | | | | | Now that we do not use sequence numbers anymore, we can simply use libports notification server functions. * libpager/Makefile (SRCS): Drop `no-senders.c', and `notify-stubs.c'. (OBJS): Drop `notifyServer.o'. * libpager/demuxer.c (pager_demuxer): Use libports server functions. * libpager/mig-mutate.h: Drop all notification mutators. * libpager/no-senders.c: Remove file. * libpager/notify-stubs.c: Likewise.
* libpager: remove the `seqno' parametersJustus Winter2014-12-1014-45/+24
| | | | | | | | | | | | | | | | | * libpager/Makefile (MIGSFLAGS): Drop `-DSEQNOS'. * libpager/priv.h (struct pager): Drop fields `seqno' and `waitingforseqno'. * libpager/chg-compl.c: Adopt accordingly. * libpager/data-request.c: Likewise. * libpager/data-return.c: Likewise. * libpager/data-unlock.c: Likewise. * libpager/demuxer.c: Likewise. * libpager/lock-completed.c: Likewise. * libpager/no-senders.c: Likewise. * libpager/notify-stubs.c: Likewise. * libpager/object-init.c: Likewise. * libpager/object-terminate.c: Likewise. * libpager/pager-create.c: Likewise. * libpager/stubs.c: Likewise.
* hurd: add `proc_make_task_namespace'Justus Winter2014-12-101-1/+10
| | | | | | | | | | | | Add a new RPC to the process protocol to create task namespaces. These can be used by an unprivileged process to claims the responsibility to manage all tasks in this namespace. Any task created in this namespace will automatically be declared a child of the root process, and a `mach_notify_new_task' message is sent to a given port. If the root process dies, the proc server will terminate all tasks in the namespace. * hurd/process.defs (proc_make_task_namespace): New RPC.
* proc: implement `proc_make_task_namespace'Justus Winter2014-12-102-9/+107
| | | | | | | | | | | | | | * proc/proc.h (struct proc): Add field `p_task_namespace'. * proc/mgt.c (S_proc_child): Propagate `p_task_namespace' to child. (allocate_proc): Initialize `p_task_namespace'. (namespace_terminate): New function. (process_has_exited): Reparent children of dead tasks in the namespace to the root process. Terminate all tasks if the root process dies. Reap dead tasks. (S_mach_notify_new_task): For newly created tasks thats parent is in a namespace, call S_proc_child and forward the `mach_notify_new_task' message. (S_proc_make_task_namespace): New function.
* proc: register for new task notificationsJustus Winter2014-12-103-3/+47
| | | | | | | * proc/Makefile (MIGSTUBS): Add `gnumachServer.o'. * proc/main.c (message_demuxer): Handle the `task_notify' protocol. (main): Register for new task notificatinos. * proc/mgt.c (S_mach_notify_new_task): Add server function.
* Makeconf: handle the task_notify protocolJustus Winter2014-12-101-0/+1
| | | | * Makeconf (mach_defs_names): Add `task_notify'.
* fakeroot: Fix initializing default faked field of nodesSamuel Thibault2014-12-101-1/+1
| | | | * trans/fakeroot.c (new_node): Initialize faked field to FAKE_DEFAULT.
* include: don't install nonexistent refcount.hDavid Michael2014-12-091-1/+1
| | | | * include/Makefile (installhdrs): Remove refcount.h.
* Fix mode of nodes created with mkfileSamuel Thibault2014-12-091-2/+12
| | | | | | | | | Their faked field was not initialized. Thanks a lot to Svante Signell for the investigation * trans/fakeroot.c (new_node): Initialize faked field of nn to 0. (netfs_attempt_mkfile): Call set_default_attributes on newly-allocated node, and if the real mode is not the same as the requested mode, fake the mode.
* hurd: add intranpayload functions to all hurd typesJustus Winter2014-12-073-1/+123
| | | | | | | | | | | | | For each hurd type defined in hurd_types.h, add a intranpayload function. If an X_INTRAN mutation is defined for a type, a corresponding X_INTRAN_PAYLOAD has to be defined. If no X_INTRAN mutation is defined, use ports_payload_get_name as intranpayload function, turning the payload back into an port name. * hurd/hurd_types.defs: Add intranpayload functions. * hurd/term.defs: Likewise. * hurd/default_pager.defs: Include `hurd_types.defs' for `MACH_PAYLOAD_TO_PORT'.
* utils/rpctrace: make `trace_and_forward' payload-awareJustus Winter2014-12-071-1/+28
| | | | | | | | As the protected payloads were retrofitted into the Mach message format, the local port type is lost. * utils/rpctrace.c (is_notification): New function (trace_and_forward): Recover the original local port type.
* trans/symlink: disable default payload to port mappingJustus Winter2014-12-071-0/+4
| | | | | | | | | `fsysServer' is only used by the symlink translator which does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * trans/Makefile (fsys-MIGSFLAGS): Disable the default payload to port translation function.
* trans/streamio: make the translator payload-awareJustus Winter2014-12-071-0/+3
| | | | * trans/Makefile (device_reply-MIGSFLAGS): Define MACH_PAYLOAD_TO_PORT.
* trans/password: add a payload-aware intrans functionJustus Winter2014-12-071-0/+1
| | | | * trans/Makefile (password-MIGSFLAGS): Add mutator.
* trans/ifsock: add a payload-aware intrans functionJustus Winter2014-12-071-0/+1
| | | | * trans/Makefile (ifsock-MIGSFLAGS): Add mutator.
* trans/fakeroot: make the demuxer payload-awareJustus Winter2014-12-071-4/+13
| | | | * trans/fakeroot.c (netfs_demuxer): Make the demuxer payload-aware.
* term: add a payload-aware intrans functionJustus Winter2014-12-073-0/+10
| | | | * term/mig-mutate.h: Add mutator.
* startup: disable default payload to port mappingJustus Winter2014-12-071-0/+4
| | | | | | | | startup does not use libports. Therefor, it is not necessary to use the default payload to port translation function. * startup/Makefile (MIGSFLAGS): Disable the default payload to port translation function.
* proc: add payload-aware intrans functionsJustus Winter2014-12-073-0/+22
| | | | | | | | * proc/mig-decls.h (begin_using_proc_payload): New function. (begin_using_exc_payload): Likewise. * proc/mig-mutate.h: Add mutators. * proc/proc_exc.defs (exception_t): Add payload-aware in-translator function.
* pflocal: add payload-aware intrans functionsJustus Winter2014-12-072-0/+15
| | | | | | * pflocal/mig-mutate.h: Add mutators. * pflocal/mig-decls.c (begin_using_sock_user_payload): New function. (begin_using_addr_payload): Likewise.
* pfinet: make the demuxers payload-awareJustus Winter2014-12-072-3/+29
| | | | | * pfinet/ethernet.c (ethernet_demuxer): Make the demuxer payload-aware. * pfinet/main.c (pfinet_demuxer): Likewise.
* pfinet: add payload-aware intrans functionsJustus Winter2014-12-072-0/+16
| | | | | | * pfinet/mig-mutate.h: Add mutators. * pfinet/mig-decls.h (begin_using_socket_payload): New function. (begin_using_sockaddr_payload): Likewise.
* exec: add payload-aware intrans functionsJustus Winter2014-12-072-0/+9
| | | | | * exec/execmutations.h: Add mutators. * exec/mig-decls.h (begin_using_bootinfo_payload): New function.
* console-client: make the demuxer payload-awareJustus Winter2014-12-071-2/+10
| | | | * console-client/trans.c (console_demuxer): make the demuxer payload-aware.
* console: add a payload-aware intrans functionJustus Winter2014-12-072-0/+9
| | | | | * console/priv.h (begin_using_protid_payload): New function. * console/mutations.h: Add mutators.
* auth: add a payload-aware intrans functionJustus Winter2014-12-072-0/+7
| | | | | * auth/mig-mutate.h: Add mutator. * auth/mig-decls.h (auth_payload_to_handle): New function.
* libcons: add a payload-aware intrans functionJustus Winter2014-12-072-0/+7
| | | | | * libcons/mutations.h: Add mutator. * libcons/priv.h (begin_using_notify_payload): New function.
* libpager: add a payload-aware intrans functionJustus Winter2014-12-072-0/+9
| | | | | * libpager/mig-decls.h (begin_using_pager_payload): New function. * libpager/mig-mutate.h: Add mutators.
* libtrivfs: add payload-aware intrans functionsJustus Winter2014-12-072-0/+61
| | | | | | * libtrivfs/mig-decls.h (trivfs_begin_using_protid_payload): New function. (trivfs_begin_using_control_payload): Likewise. * libtrivfs/mig-mutate.h: Add mutators.
* libnetfs: add a payload-aware intrans functionJustus Winter2014-12-072-0/+9
| | | | | * libnetfs/priv.h (begin_using_protid_payload): New function. * libnetfs/mutations.h: Add mutator.
* libdiskfs: add payload-aware intrans functionsJustus Winter2014-12-072-0/+34
| | | | | | | * libdiskfs/diskfs.h (diskfs_begin_using_protid_payload): New function. (diskfs_begin_using_control_payload): Likewise. (diskfs_begin_using_bootinfo_payload): Likewise. * libdiskfs/fsmutations.h: Add mutators.
* libports: add a payload-aware intrans functionJustus Winter2014-12-072-0/+10
| | | | | * libports/mig-decls.h (begin_using_port_info_payload): New function. * libports/mig-mutate.h: Add mutator.
* libports: add `ports_lookup_payload' and `ports_payload_get_name'Justus Winter2014-12-073-1/+76
| | | | | | | | | | | | These two functions map payloads to objects and port names. The former can be used like `ports_lookup_port' to look up objects, the latter to map payloads to port names if the server function expects a `mach_port_t'. * libports/ports.h: Add function ports_payload_get_name. * libports/lookup-payload.c: New file. * libports/ports.h (ports_lookup_payload): Add declaration. * libports/Makefile (SRCS): Add lookup-payload.c.
* Fix coding styleSamuel Thibault2014-12-061-1/+1
|
* libshouldbeinlibc: move the reference counting primitives hereJustus Winter2014-12-013-19/+52
| | | | | | | | | | Declare all functions `extern inline' instead of `static inline'. This allows us to use them in functions declared as `extern inline'. * libshouldbeinlibc/refcount.h: Move here, and declare all functions `extern inline'. * libshouldbeinlibc/refcount.c: And define the functions here. * libshouldbeinlibc/Makefile: Add `refcount.{c,h}'.
* Revert "random: fix a receiver lookup"Justus Winter2014-11-284-74/+4
| | | | | | | This reverts "8927fbd63e29005ddb9b2c2264046089bf669857". The change mistakenly adds mutators for the `startup' protocol, but the server routine is for the `startup_notify' protocol.
* Add atomicity support to fshelp_acquire_lockSamuel Thibault2014-11-271-18/+77
| | | | | | | | | | This adds support for the __LOCK_ATOMIC flag which requests atomicity of SH->EX upgrades and EX->SH downgrades. * libfshelp/lock-acquire.c (__LOCK_ATOMIC): New macro (fshelp_acquire_lock): When __LOCK_ATOMIC is set, do not release the lock early, change the lock hold atomically instead. On upgrade to LOCK_EX, prevent new shared locks from being acquired to avoid starvation.
* Fix proc crashesSamuel Thibault2014-11-271-2/+4
| | | | | * proc/notify.c (do_mach_notify_dead_name): When `pi' is NULL, immediately return EOPNOTSUPP.
* libdiskfs: fix fabrication of protidJustus Winter2014-11-231-1/+2
| | | | * libdiskfs/dir-init.c (diskfs_init_dir): Fix fabrication of protid.
* libpager: make the request queue more memory-efficientJustus Winter2014-11-231-17/+49
| | | | | | | | | | | | | | | | | | Previously, `pager_demuxer' allocated a chunk of memory for the response message. But if memory gets scarce, the kernel will issue a large number of paging requests to free up memory. In such a situation, allocating memory is dangerous. Fix this by not allocating space for the response message, rather, use a chunk of the workers stack space. Also, we only handle the `notify' and `memory_object' protocol, which both only contain simple routines, we only need a `mig_response_header_t'. * libpager/demuxer.c (struct request): Remove `inp' and `outp'. (request_inp): New function. (pager_demuxer): Do not allocate memory for the response. (mig_reply_setup): New function. (worker_func): Adjust accordingly.
* boot: improve the demuxerJustus Winter2014-11-211-18/+49
| | | | | | | | | | Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. * boot/boot.c (mig_reply_setup): Provide local version. (request_server): Rename to `boot_demuxer', and improve the dispatch.
* boot: implement pseudo-time deviceJustus Winter2014-11-211-3/+35
| | | | | | | * boot/boot.c (pseudo_time): New variable. (main): Allocate port `pseudo_time'. (ds_device_open): Give out `pseudo_time'. (ds_device_map): Emulate Mach-style `Mapped Time'.