summaryrefslogtreecommitdiff
path: root/proc/mgt.c
AgeCommit message (Collapse)Author
2015-03-05Fix space styleSamuel Thibault
2014-12-10proc: implement `proc_make_task_namespace'Justus Winter
* 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.
2014-12-10proc: register for new task notificationsJustus Winter
* 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.
2014-11-21Add proc_set_init_task, make runsystem pid 1Justus Winter
* hurd/process.defs (proc_set_init_task): New procedure. * hurd/process_reply.defs (proc_set_init_task): Likewise. * hurd/process_request.defs (proc_set_init_task): Likewise. * include/pids.h: Add HURD_PID_INIT as 1, adjust others accordingly. * init/init.c (start_child): Register the child task. * proc/proc.h (init_proc): New variable. (create_startup_proc): Rename to create_init_proc. * proc/main.c (main): Create placeholder proc object for pid 1. * proc/mgt.c: Use init_proc instead of startup_proc, as the former is the new root of the process tree. (create_startup_proc): Rename to create_init_proc. (S_proc_set_init_task): New function. * doc/hurd.texi (Server Bootstrap): Update accordingly. * procfs/main.c: Do not hard-code kernel pid, use pids.h instead.
2014-04-22Add missing receiver lookup fixSamuel Thibault
following 7cb7fa6b3a0d02985b4a51f7823bc1cb631d6bfa * proc/mgt.c (S_proc_exception_raise): Do not dereference e on returning EINVAL, the translation functions does it for us.
2014-01-20proc: fix the receiver lookup in S_proc_exception_raiseJustus Winter
* proc/mgt.c (S_proc_exception_raise): Update accordingly. * proc/mig-decls.h: New file. * proc/proc_exc.defs: Add translation functions.
2013-11-28proc: store the privileged host port in _hurd_host_privJustus Winter
Store the privileged host port in _hurd_host_priv like it is done in the root filesystem. This fixes the thread priority adjustment in the proc server. Prior to this fix, a warning message "unable to adjust libports thread priority" sometimes appeared early in the boot process. * proc/host.c (S_proc_getprivports): Adapt accordingly. (S_proc_register_version): Likewise. * proc/mgt.c (add_tasks): Likewise. * proc/msg.c (tickle_init): Likewise. * proc/main.c (main): Store the privileged host port in _hurd_host_priv. * proc/proc.h: Remove unused variable master_host_port. fixup_store_priv_port
2013-11-10proc: turn count_up and store_pid into normal functionsJustus Winter
Previously count_up and store_pid were defined inside S_proc_getallpids. Move them out of that function and declare them static. * proc/mgt.c: Turn count_up and store_pid into normal functions.
2013-11-09proc: fix error handling in S_proc_exception_raiseJustus Winter
Found using the Clang Static Analyzer. * proc/mgt.c (S_proc_exception_raise): Fix error propagation.
2013-09-21proc: do not hand out PID 0Justus Winter
Using PID 0 causes various problems. This makes genpid skip PID 0. * proc/mgt.c (genpid): Start PIDs at 1.
2013-09-15proc: keep track of {start,end}_codeJustus Winter
Any executable segments loaded from the ELF binary are in this range. * proc/proc.h (struct proc): Add {start,end}_code. * proc/mgt.h (S_proc_set_code): New function. * proc/mgt.h (S_proc_get_code): New function.
2013-08-29proc: add proc_mark_important server codeJustus Winter
This is based on a fragment of Guillem Jovers patch presented here: http://lists.gnu.org/archive/html/bug-hurd/2006-02/msg00081.html It has been refreshed, updated and the copyright year is adjusted properly. It has been complemented with the necessary features to address the issues the original patch set out to address, namely that killall5 freezes the proc translator before it tries to walk over /proc/*/stat to decide which process to kill. Prior to this patch (and the one marking the procfs server as important process), killall5 would deadlock trying to walk over the proc file system. Ironically it would not have killed any process later on even if it had the chance, since two values obtained from /proc/*/stat are currently hardcoded to zero in our procfs. Patches addressing the problem as a whole are prepared and will be sent as a follow up. * proc/proc.h (struct proc): Add p_important field. * proc/pgrp.c (S_proc_getpgrppids): Exclude important system processes. (S_proc_mark_important): New function. * proc/mgt.c (create_startup_proc): Mark init as important.
2013-08-28Define and use symbolic names for important processesJustus Winter
* include/pids.h: New file. * init/init.c (frob_kernel_process): Use symbolic name for kernel process. * exec/exec.c (S_exec_init): Use symbolic name for startup process. * libdiskfs/boot-start.c (diskfs_S_fsys_init): Likewise. * libdiskfs/init-startup.c (_diskfs_init_completed): Likewise. * pfinet/main.c (arrange_shutdown_notification): Likewise. * proc/mgt.c (create_startup_proc): Likewise. * proc/main.c (main): Use symbolic name for proc process.
2012-11-27Switch from cthreads to pthreadsRichard Braun
Makefiles, headers, types, macros and function calls are renamed where appropriate. Most of this work was done by Barry deFreese and Thomas DiModica. * auth/Makefile: Switch from cthreads to pthreads. * auth/auth.c: Likewise. * boot/Makefile: Likewise. * boot/boot.c: Likewise. * boot/ux.c: Likewise. * console-client/Makefile: Likewise. * console-client/console.c: Likewise. * console-client/driver.c: Likewise. * console-client/driver.h: Likewise. * console-client/generic-speaker.c: Likewise. * console-client/kbd-repeat.c: Likewise. * console-client/ncursesw.c: Likewise. * console-client/pc-kbd.c: Likewise. * console-client/pc-mouse.c: Likewise. * console-client/timer.c: Likewise. * console-client/trans.c: Likewise. * console-client/vga.c: Likewise. * console/Makefile: Likewise. * console/console.c: Likewise. * console/display.c: Likewise. * console/input.c: Likewise. * console/pager.c: Likewise. * defpager/backing.c: Likewise. * exec/Makefile: Likewise. * exec/exec.c: Likewise. * exec/hashexec.c: Likewise. * exec/priv.h: Likewise. * ext2fs/Makefile: Likewise. * ext2fs/balloc.c: Likewise. * ext2fs/dir.c: Likewise. * ext2fs/ext2fs.c: Likewise. * ext2fs/ext2fs.h: Likewise. * ext2fs/ialloc.c: Likewise. * ext2fs/inode.c: Likewise. * ext2fs/msg.c: Likewise. * ext2fs/pager.c: Likewise. * ext2fs/pokel.c: Likewise. * ext2fs/storeinfo.c: Likewise. * ext2fs/truncate.c: Likewise. * fatfs/Makefile: Likewise. * fatfs/dir.c: Likewise. * fatfs/fat.c: Likewise. * fatfs/fatfs.h: Likewise. * fatfs/inode.c: Likewise. * fatfs/main.c: Likewise. * fatfs/pager.c: Likewise. * fatfs/virt-inode.c: Likewise. * ftpfs/Makefile: Likewise. * ftpfs/ccache.c: Likewise. * ftpfs/ccache.h: Likewise. * ftpfs/conn.c: Likewise. * ftpfs/dir.c: Likewise. * ftpfs/fs.c: Likewise. * ftpfs/ftpfs.c: Likewise. * ftpfs/ftpfs.h: Likewise. * ftpfs/ncache.c: Likewise. * ftpfs/netfs.c: Likewise. * ftpfs/node.c: Likewise. * hostmux/Makefile: Likewise. * hostmux/hostmux.h: Likewise. * hostmux/mux.c: Likewise. * hostmux/node.c: Likewise. * hostmux/stubs.c: Likewise. * hurd/shared.h: Likewise. * isofs/Makefile: Likewise. * isofs/inode.c: Likewise. * isofs/lookup.c: Likewise. * isofs/main.c: Likewise. * isofs/pager.c: Likewise. * libcons/Makefile: Likewise. * libcons/cons-switch.c: Likewise. * libcons/cons.h: Likewise. * libcons/dir-changed.c: Likewise. * libcons/file-changed.c: Likewise. * libcons/init-init.c: Likewise. * libcons/vcons-close.c: Likewise. * libcons/vcons-input.c: Likewise. * libcons/vcons-move-mouse.c: Likewise. * libcons/vcons-open.c: Likewise. * libcons/vcons-scrollback.c: Likewise. * libdiskfs/Makefile: Likewise. * libdiskfs/boot-start.c: Likewise. * libdiskfs/dead-name.c: Likewise. * libdiskfs/dir-chg.c: Likewise. * libdiskfs/dir-link.c: Likewise. * libdiskfs/dir-lookup.c: Likewise. * libdiskfs/dir-mkdir.c: Likewise. * libdiskfs/dir-mkfile.c: Likewise. * libdiskfs/dir-readdir.c: Likewise. * libdiskfs/dir-rename.c: Likewise. * libdiskfs/dir-renamed.c: Likewise. * libdiskfs/dir-rmdir.c: Likewise. * libdiskfs/dir-unlink.c: Likewise. * libdiskfs/disk-pager.c: Likewise. * libdiskfs/diskfs-pager.h: Likewise. * libdiskfs/diskfs.h: Likewise. * libdiskfs/file-access.c: Likewise. * libdiskfs/file-chg.c: Likewise. * libdiskfs/file-exec.c: Likewise. * libdiskfs/file-get-fs-opts.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libdiskfs/file-get-transcntl.c: Likewise. * libdiskfs/file-getcontrol.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-lock-stat.c: Likewise. * libdiskfs/file-lock.c: Likewise. * libdiskfs/file-reparent.c: Likewise. * libdiskfs/file-set-trans.c: Likewise. * libdiskfs/file-sync.c: Likewise. * libdiskfs/file-syncfs.c: Likewise. * libdiskfs/fsys-getroot.c: Likewise. * libdiskfs/fsys-options.c: Likewise. * libdiskfs/fsys-syncfs.c: Likewise. * libdiskfs/ifsock.c: Likewise. * libdiskfs/init-first.c: Likewise. * libdiskfs/init-init.c: Likewise. * libdiskfs/init-startup.c: Likewise. * libdiskfs/io-duplicate.c: Likewise. * libdiskfs/io-get-conch.c: Likewise. * libdiskfs/io-identity.c: Likewise. * libdiskfs/io-map-cntl.c: Likewise. * libdiskfs/io-map.c: Likewise. * libdiskfs/io-modes-get.c: Likewise. * libdiskfs/io-modes-off.c: Likewise. * libdiskfs/io-modes-on.c: Likewise. * libdiskfs/io-modes-set.c: Likewise. * libdiskfs/io-owner-get.c: Likewise. * libdiskfs/io-owner-mod.c: Likewise. * libdiskfs/io-prenotify.c: Likewise. * libdiskfs/io-read.c: Likewise. * libdiskfs/io-readable.c: Likewise. * libdiskfs/io-reauthenticate.c: Likewise. * libdiskfs/io-rel-conch.c: Likewise. * libdiskfs/io-restrict-auth.c: Likewise. * libdiskfs/io-revoke.c: Likewise. * libdiskfs/io-seek.c: Likewise. * libdiskfs/io-sigio.c: Likewise. * libdiskfs/io-stat.c: Likewise. * libdiskfs/io-write.c: Likewise. * libdiskfs/lookup.c: Likewise. * libdiskfs/name-cache.c: Likewise. * libdiskfs/node-drop.c: Likewise. * libdiskfs/node-make.c: Likewise. * libdiskfs/node-nput.c: Likewise. * libdiskfs/node-nputl.c: Likewise. * libdiskfs/node-nref.c: Likewise. * libdiskfs/node-nrefl.c: Likewise. * libdiskfs/node-nrele.c: Likewise. * libdiskfs/node-nrelel.c: Likewise. * libdiskfs/peropen-rele.c: Likewise. * libdiskfs/priv.h: Likewise. * libdiskfs/shutdown.c: Likewise. * libdiskfs/sync-interval.c: Likewise. * libfshelp/Makefile: Likewise. * libfshelp/fetch-root.c: Likewise. * libfshelp/fshelp.h: Likewise. * libfshelp/get-identity.c: Likewise. * libfshelp/lock-acquire.c: Likewise. * libfshelp/lock-init.c: Likewise. * libfshelp/locks.h: Likewise. * libfshelp/set-active.c: Likewise. * libfshelp/trans.h: Likewise. * libfshelp/transbox-init.c: Likewise. * libiohelp/Makefile: Likewise. * libiohelp/get_conch.c: Likewise. * libiohelp/handle_io_release_conch.c: Likewise. * libiohelp/initialize_conch.c: Likewise. * libiohelp/iohelp.h: Likewise. * libiohelp/verify_user_conch.c: Likewise. * libnetfs/Makefile: Likewise. * libnetfs/dir-lookup.c: Likewise. * libnetfs/dir-mkdir.c: Likewise. * libnetfs/dir-mkfile.c: Likewise. * libnetfs/dir-readdir.c: Likewise. * libnetfs/dir-rmdir.c: Likewise. * libnetfs/dir-unlink.c: Likewise. * libnetfs/drop-node.c: Likewise. * libnetfs/file-chauthor.c: Likewise. * libnetfs/file-check-access.c: Likewise. * libnetfs/file-chflags.c: Likewise. * libnetfs/file-chmod.c: Likewise. * libnetfs/file-chown.c: Likewise. * libnetfs/file-exec.c: Likewise. * libnetfs/file-get-storage-info.c: Likewise. * libnetfs/file-get-translator.c: Likewise. * libnetfs/file-lock-stat.c: Likewise. * libnetfs/file-lock.c: Likewise. * libnetfs/file-reparent.c: Likewise. * libnetfs/file-set-size.c: Likewise. * libnetfs/file-set-translator.c: Likewise. * libnetfs/file-statfs.c: Likewise. * libnetfs/file-sync.c: Likewise. * libnetfs/file-syncfs.c: Likewise. * libnetfs/file-utimes.c: Likewise. * libnetfs/fsys-getroot.c: Likewise. * libnetfs/fsys-set-options.c: Likewise. * libnetfs/init-init.c: Likewise. * libnetfs/io-clear-some-openmodes.c: Likewise. * libnetfs/io-duplicate.c: Likewise. * libnetfs/io-get-openmodes.c: Likewise. * libnetfs/io-get-owner.c: Likewise. * libnetfs/io-identity.c: Likewise. * libnetfs/io-mod-owner.c: Likewise. * libnetfs/io-read.c: Likewise. * libnetfs/io-readable.c: Likewise. * libnetfs/io-reauthenticate.c: Likewise. * libnetfs/io-restrict-auth.c: Likewise. * libnetfs/io-revoke.c: Likewise. * libnetfs/io-seek.c: Likewise. * libnetfs/io-set-all-openmodes.c: Likewise. * libnetfs/io-set-some-openmodes.c: Likewise. * libnetfs/io-stat.c: Likewise. * libnetfs/io-write.c: Likewise. * libnetfs/make-node.c: Likewise. * libnetfs/netfs.h: Likewise. * libnetfs/nput.c: Likewise. * libnetfs/nref.c: Likewise. * libnetfs/nrele.c: Likewise. * libnetfs/release-peropen.c: Likewise. * libnetfs/shutdown.c: Likewise. * libpager/Makefile: Likewise. * libpager/chg-compl.c: Likewise. * libpager/clean.c: Likewise. * libpager/data-request.c: Likewise. * libpager/data-return.c: Likewise. * libpager/data-unlock.c: Likewise. * libpager/inhibit-term.c: Likewise. * libpager/lock-completed.c: Likewise. * libpager/lock-object.c: Likewise. * libpager/mark-error.c: Likewise. * libpager/no-senders.c: Likewise. * libpager/object-init.c: Likewise. * libpager/object-terminate.c: Likewise. * libpager/offer-page.c: Likewise. * libpager/pager-attr.c: Likewise. * libpager/pager-create.c: Likewise. * libpager/pager-shutdown.c: Likewise. * libpager/priv.h: Likewise. * libpager/seqnos.c: Likewise. * libpipe/Makefile: Likewise. * libpipe/pipe.c: Likewise. * libpipe/pipe.h: Likewise. * libports/Makefile: Likewise. * libports/begin-rpc.c: Likewise. * libports/bucket-iterate.c: Likewise. * libports/claim-right.c: Likewise. * libports/class-iterate.c: Likewise. * libports/complete-deallocate.c: Likewise. * libports/count-bucket.c: Likewise. * libports/count-class.c: Likewise. * libports/create-bucket.c: Likewise. * libports/create-internal.c: Likewise. * libports/destroy-right.c: Likewise. * libports/enable-bucket.c: Likewise. * libports/enable-class.c: Likewise. * libports/end-rpc.c: Likewise. * libports/get-right.c: Likewise. * libports/import-port.c: Likewise. * libports/inhibit-all-rpcs.c: Likewise. * libports/inhibit-bucket-rpcs.c: Likewise. * libports/inhibit-class-rpcs.c: Likewise. * libports/inhibit-port-rpcs.c: Likewise. * libports/init.c: Likewise. * libports/interrupt-notified-rpcs.c: Likewise. * libports/interrupt-on-notify.c: Likewise. * libports/interrupt-operation.c: Likewise. * libports/interrupt-rpcs.c: Likewise. * libports/interrupted.c: Likewise. * libports/lookup-port.c: Likewise. * libports/manage-multithread.c: Likewise. * libports/no-senders.c: Likewise. * libports/port-deref-weak.c: Likewise. * libports/port-deref.c: Likewise. * libports/port-ref-weak.c: Likewise. * libports/port-ref.c: Likewise. * libports/ports.h: Likewise. * libports/reallocate-from-external.c: Likewise. * libports/reallocate-port.c: Likewise. * libports/resume-all-rpcs.c: Likewise. * libports/resume-bucket-rpcs.c: Likewise. * libports/resume-class-rpcs.c: Likewise. * libports/resume-port-rpcs.c: Likewise. * libports/stubs.c: Likewise. * libports/transfer-right.c: Likewise. * libstore/Makefile: Likewise. * libstore/gunzip.c: Likewise. * libstore/part.c: Likewise. * libstore/unzipstore.c: Likewise. * libthreads/Makefile: Likewise. * libtreefs/dir-lookup.c: Likewise. * libtreefs/fsys-getroot.c: Likewise. * libtreefs/fsys-hooks.c: Likewise. * libtreefs/fsys.c: Likewise. * libtreefs/trans-help.c: Likewise. * libtreefs/trans-start.c: Likewise. * libtreefs/treefs.h: Likewise. * libtrivfs/cntl-create.c: Likewise. * libtrivfs/dyn-classes.c: Likewise. * libtrivfs/io-reauthenticate.c: Likewise. * libtrivfs/io-restrict-auth.c: Likewise. * libtrivfs/protid-clean.c: Likewise. * libtrivfs/protid-dup.c: Likewise. * libtrivfs/trivfs.h: Likewise. * mach-defpager/Makefile: Likewise. * mach-defpager/default_pager.c: Likewise. * mach-defpager/kalloc.c: Likewise. * mach-defpager/main.c: Likewise. * nfs/Makefile: Likewise. * nfs/cache.c: Likewise. * nfs/main.c: Likewise. * nfs/mount.c: Likewise. * nfs/name-cache.c: Likewise. * nfs/nfs.h: Likewise. * nfs/ops.c: Likewise. * nfs/rpc.c: Likewise. * nfsd/Makefile: Likewise. * nfsd/cache.c: Likewise. * nfsd/loop.c: Likewise. * nfsd/main.c: Likewise. * nfsd/nfsd.h: Likewise. * pfinet/Makefile: Likewise. * pfinet/ethernet.c: Likewise. * pfinet/glue-include/asm/spinlock.h: Likewise. * pfinet/glue-include/linux/interrupt.h: Likewise. * pfinet/glue-include/linux/sched.h: Likewise. * pfinet/glue-include/linux/timer.h: Likewise. * pfinet/glue-include/linux/wait.h: Likewise. * pfinet/iioctl-ops.c: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/kmem_cache.c: Likewise. * pfinet/main.c: Likewise. * pfinet/options.c: Likewise. * pfinet/pfinet-ops.c: Likewise. * pfinet/pfinet.h: Likewise. * pfinet/sched.c: Likewise. * pfinet/socket-ops.c: Likewise. * pfinet/socket.c: Likewise. * pfinet/timer-emul.c: Likewise. * pfinet/tunnel.c: Likewise. * pflocal/Makefile: Likewise. * pflocal/connq.c: Likewise. * pflocal/io.c: Likewise. * pflocal/sock.c: Likewise. * pflocal/sock.h: Likewise. * pflocal/socket.c: Likewise. * pflocal/sserver.c: Likewise. * proc/Makefile: Likewise. * proc/info.c: Likewise. * proc/main.c: Likewise. * proc/mgt.c: Likewise. * proc/msg.c: Likewise. * proc/proc.h: Likewise. * proc/stubs.c: Likewise. * proc/wait.c: Likewise. * storeio/Makefile: Likewise. * storeio/dev.c: Likewise. * storeio/dev.h: Likewise. * storeio/open.c: Likewise. * storeio/open.h: Likewise. * storeio/pager.c: Likewise. * storeio/storeio.c: Likewise. * term/Makefile: Likewise. * term/devio.c: Likewise. * term/hurdio.c: Likewise. * term/main.c: Likewise. * term/munge.c: Likewise. * term/ptyio.c: Likewise. * term/term.h: Likewise. * term/users.c: Likewise. * tmpfs/Makefile: Likewise. * tmpfs/dir.c: Likewise. * tmpfs/node.c: Likewise. * tmpfs/tmpfs.c: Likewise. * tmpfs/tmpfs.h: Likewise. * trans/Makefile: Likewise. * trans/fakeroot.c: Likewise. * trans/fifo.c: Likewise. * trans/hello-mt.c: Likewise. * trans/new-fifo.c: Likewise. * trans/streamio.c: Likewise. * ufs/Makefile: Likewise. * ufs/alloc.c: Likewise. * ufs/dir.c: Likewise. * ufs/hyper.c: Likewise. * ufs/inode.c: Likewise. * ufs/main.c: Likewise. * ufs/pager.c: Likewise. * ufs/pokeloc.c: Likewise. * ufs/sizes.c: Likewise. * ufs/ufs.h: Likewise. * usermux/Makefile: Likewise. * usermux/mux.c: Likewise. * usermux/node.c: Likewise. * usermux/usermux.h: Likewise. * utils/Makefile: Likewise. * utils/fakeauth.c: Likewise. * utils/rpctrace.c: Likewise.
2011-08-11Fix spurious port deallocationSamuel Thibault
* proc/mgt.c (S_proc_exception_raise): On proc_exception_raise forwarding error, return MIG_NO_REPLY instead of 0, since the reply port may have been consumed, and the task is being terminated anyway.
2003-08-162003-08-17 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* mgt.c (S_proc_dostop): Revert last change.
2003-08-092003-06-16 Ognyan Kulev <ogi@fmi.uni-sofia.bg>Marcus Brinkmann
* mgt.c (S_proc_dostop): Instead of suspending all threads except CONTTHREAD, first suspend all threads, and then resume CONTTHREAD.
2002-05-082002-05-07 Roland McGrath <roland@frob.com>Roland McGrath
* mgt.c (S_proc_reauthenticate, S_proc_getallpids): Likewise. (add_tasks, S_proc_dostop): Likewise. (S_proc_exception_raise): int -> integer_t * pgrp.c (S_proc_getsessionpids, S_proc_getsessionpgids): Likewise. (S_proc_getpgrppids): Likewise.
2001-08-142001-08-14 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* mgt.c (S_proc_dostop): If task_threads fails, resume the suspended task.
2001-08-062001-08-06 Roland McGrath <roland@frob.com>Roland McGrath
* mgt.c (allocate_proc): Don't zero P->p_pi. Reported by Neal H Walfield <neal@cs.uml.edu>.
2001-08-042001-08-04 Roland McGrath <roland@frob.com>Roland McGrath
* mgt.c (process_has_exited): Call ports_interrupt_rpcs last thing.
2001-08-042001-08-04 Roland McGrath <roland@frob.com>Roland McGrath
* mgt.c (S_proc_reauthenticate): Release global_lock while making RPC. Don't mach_port_deallocate an argument port when returning an error, because mig does it for us. 2001-08-03 Roland McGrath <roland@frob.com> * mgt.c (allocate_proc): Use memset instead of lots of 0 initializers.
2001-08-022001-08-01 Roland McGrath <roland@frob.com>Roland McGrath
* mgt.c (genpid): Rewritten.
2001-08-022001-08-02 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* mgt.c (genpid): Before checking if NEXTPID is free, check if it is greater than WRAP, and if yes, start over.
2001-04-152000-04-03 Neal H Walfield <neal@cs.uml.edu>Roland McGrath
* proc.h (struct ids): Drop gids and ngids, we never use them. Turn uids into a zero length array. * mgt.c (make_ids): Conform to new semantics. (ids_free): Removed. Rendered obsolete by ids_rele. (ids_rele): New function. Drop a reference to the given ids. (ids_ref): Add a reference to the given ids. (S_proc_reauthenticate): Use ids_rele and new make_ids semantics. (S_proc_child): Use ids_rele and ids_ref. (create_startup_proc): Conform to new make_ids semantics. (complete_proc): Use ids_ref. (process_has_exited): Use ids_rele. * host.c: Doc fix: ``Implement foo as described in <hurd/proc.defs>'' => ``Implement foo as described in <hurd/process.defs>'' * info.c: Likewise. * mgt.c: Likewise. * pgrp.c: Likewise. * wait.c: Likewise. * mgt.c (S_proc_reauthenticate): Calculate the value of NGEN_UIDS, NAUX_UIDS, NGEN_GIDS AND NAUX_GIDS; do not use a constant. (create_startup_proc): Add asserts. * host.c (S_proc_setexecdata): Check for memory allocation errors. Use memcpy, not bcopy. (S_proc_getexecdata): Likewise. (S_proc_execdata_notify): Check return of malloc. (S_proc_register_version): Likewise. (initialize_version_info): Add asserts. * info.c (S_proc_pid2task): Do not bother searching for the pid if we do not have a valid caller. (S_proc_pid2proc): Likewise. Use memcpy, not bcopy. (S_proc_getprocinfo): Doc fixes. Use MAP_FAILED not -1. Use memcpy, not bcopy. (S_proc_getloginpids): Check return value of malloc. Use realloc correctly. (S_proc_setlogin): Check return value of malloc. * main.c (main): Assert allocate_proc. * mgt.c (make_ids): Check return value of malloc and fail accordingly. (S_proc_reauthenticate): Check return value of make_ids and fail accordingly. (S_proc_child): Call task_find after we know that we were passed a valid child. (S_proc_reassign): Likewise. (S_proc_handle_exceptions): Use memcpy, not bcopy. (allocate_proc): Check return value of ports_create_port and fail accordingly. (create_startup_proc): Add asserts. (complete_proc): Do not assume the length of "<none>". * msg.c (S_proc_getmsgport): Call pid_find_allow_zombie after we know we were passed a valid caller. * pgrp.c: Include assert.h. (new_pgrp): Check return value of malloc and fail accordingly. (new_session): Likewise. (boot_setsid): Assert sess. (S_proc_getsessionpids): Use MAP_FAILED not -1. (S_proc_getsessionppids): Likewise. (S_proc_getpgrppids): Likewise. * wait.c (S_proc_wait): Use memset, not bzero.
2000-03-142000-03-13 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* mgt.c (S_proc_exception_raise): Check for MACH_SEND_NOTIFY_IN_PROGRESS rather than MACH_SEND_INVALID_NOTIFY. Don't deallocate THREAD and TASK ports before the switch, since the successful case uses THREAD again and the failure case uses TASK again. Instead, deallocate them at the end of the successful case. At the end of the error case, use mach_port_destroy on THREAD only.
2000-03-122000-03-12 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* mgt.c (allocate_proc): Don't do mach_port_request_notification here. (proc_death_notify): New function, do it here instead. (complete_proc): Call proc_death_notify. * main.c (main): Call proc_death_notify on STARTUP_PROC after we have set its task port. * proc.h: Declare proc_death_notify.
1999-07-111999-07-09 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* info.c (get_string_array): Use mmap instead of vm_allocate. (S_proc_getprocinfo): Likewise. (S_proc_getloginpids): Likewise. * mgt.c (S_proc_getallpids): Likewise. * pgrp.c (S_proc_getsessionpids): Likewise. (S_proc_getsessionpgids): Likewise. (S_proc_getpgrppids): Likewise.
1999-07-111999-07-10 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* info.c: Add #include <sys/mman.h> for munmap decl. * mgt.c: Likewise.
1999-07-031999-07-03 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* info.c (get_string): Use munmap instead of vm_deallocate. (get_vector): Likewise. (get_string_array): Likewise. (S_proc_getprocinfo): Likewise. * mgt.c (S_proc_reauthenticate): Likewise. (S_proc_dostop): Likewise. (add_tasks): Likewise.
1999-06-051999-06-05 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* mgt.c (create_startup_proc): Don't call add_proc_to_hash here. * main.c (main): Do it here instead, after we have the task port.
1999-06-051999-06-05 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* mgt.c (allocate_proc, complete_proc): New functions, broken out of new_proc. Remove magic handling of PIDs 0 and 1. (new_proc): Now just call those two. Made static. (create_startup_proc): New function, also broken out of old new_proc. Do special setup for PID 1 (init) proc structure here. * proc.h: Update decls. * main.c (main): Use create_startup_proc for startup_proc, and allocate_proc + complete_proc (with PID 0) for self_proc. * mgt.c (make_ids): Add const to arguments.
1999-05-301999-05-29 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* mgt.c (add_tasks): Skip invalid (null) rights in tasks array. * info.c (S_proc_pid2task): Add assert for p_task right validity.
1999-03-141999-03-14 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* mgt.c (S_proc_reassign): Remove unused variable FOO.
1999-03-121999-03-11 Mark Kettenis <kettenis@gnu.org>Thomas Bushnell
* notify.c (do_mach_notify_dead_name): Remove unnecessary braces. * msg.c (S_proc_setmsgport): Remove unused variable FOO. (S_proc_getmsgport): Only check if the message port is still alive if it is not MACH_PORT_NULL. Use mach_port_type instead of mach_port_get_refs to check if the port is dead. * mgt.c (S_proc_reassign): Use mach_port_destroy to release the old task port.
1999-03-09Tue Mar 9 13:11:43 1999 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* notify.c (do_mach_notify_dead_name): Don't check against P->p_msgport anymore. * msg.c (message_port_dead): Delete function. (S_proc_setmsgport): Don't request a dead-name notification anymore. (S_proc_getmsgport): Check to see if P->p_msgport is dead before returning it. * mgt.c (S_proc_reassign): Only use mach_port_deallocate to release P->msgport. (process_has_exited): Likewise. * proc.h (message_port_dead): Delete prototype.
1999-03-09Tue Mar 9 13:11:43 1999 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* mgt.c (S_proc_reassign): It's not necessary to re-request the task-death notification; we've moved both the task right and the proc port that gets the notification, so delete that. * mgt.c (S_proc_reassign): Use mach_port_destroy instead of mach_port_deallocate to release P->p_msgport, for the same reasons as the changes below.
1999-03-07Sun Mar 7 18:19:07 1999 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* mgt.c (process_has_exited): Use mach_port_destroy instead of mach_port_deallocate to release P->p_msgport. (complete_exit): Likewise for P->p_task. These changes eliminate a race; we are destroying the receiver of the dead-name notifications on these ports, but if that means we lose a notification, then the ref-count on the name will get incremented and we can't re-decrement it since we never hear the notification.
1996-07-18*** empty log message ***Michael I. Bushnell
1996-07-18*** empty log message ***Michael I. Bushnell
1996-07-18Thu Jul 18 04:15:49 1996 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* mgt.c (add_tasks): Fix vm_deallocate call to use mach_task_self () instead of mach_host_self ().
1996-07-08(S_proc_reauthenticate): Don't use unsafe MOVE_SEND in user-sideMichael I. Bushnell
interruptible RPC.
1996-07-03(process_has_exited): When reparenting children to init, if one ofMichael I. Bushnell
them is dead, alert init.
1996-05-24(process_has_exited): Don't call alert_parent if P->p_task is nullMichael I. Bushnell
(which happens only if this is the stub process in proc_reassign). This because the parent is uninvolved in the death of stubp.
1996-05-10(S_proc_exception_raise): Fetch sigcode from correctly named member ofMichael I. Bushnell
HSD.
1996-05-09(S_proc_reauthenticate): Use new authentication interface.Michael I. Bushnell
(S_proc_setowner): Expect and interpret new CLEAR parm. (S_proc_exception_raise): Set P->p_sigcode; use new _hurd_exception2signal args.
1996-04-15(process_has_exited): Clear p->p_waited.Michael I. Bushnell
1996-03-29(S_proc_reassign): Use new ports_transfer_right call instead ofMichael I. Bushnell
claim/install sequence; the latter has leaves the port out of any hash table for a time, which produces a race with incoming messages.
1996-03-21(new_proc): Oops, reinstall code to request dead name notification onMichael I. Bushnell
the task port.
1996-03-20(complete_exit): Leave pgrp here.Michael I. Bushnell
(process_has_exited): Not here.