summaryrefslogtreecommitdiff
path: root/proc/pgrp.c
AgeCommit message (Collapse)Author
2017-08-05Use our own variant of 'assert' and 'assert_perror'.Justus Winter
Our variants print stack traces on failures. This will make locating errors much easier.
2017-03-11proc: Hierarchical proc servers.Justus Winter
Previously, a Subhurd's tasks were shown as weird processes in the Motherhurd. This change connects the proc server in the Motherhurd with the proc server in the Subhurd, embedding the Subhurd's process hierarchy. Subhurd's processes can now be inspected and debugged like any other process. * NEWS: Update. * boot/boot.c (mach_msg_forward): New function. (boot_demuxer): Forward messages arriving on the new task notification port from the proc server, and forward them to the proc server inside the Subhurd via the notification port. * proc/info.c (S_proc_task2proc): Relay request for processes in a task namespace to the Subhurd's proc server. (S_proc_pid2proc): Likewise. (S_proc_getprocargs): Likewise. (S_proc_getprocenv): Likewise. (S_proc_getprocinfo): Likewise. Translate PIDs. (S_proc_getloginid): Likewise. (S_proc_getloginpids): Likewise. * proc/mgt.c (namespace_is_subprocess): New function. (namespace_translate_pids): Likewise. * proc/msg.c (S_proc_getmsgport): Relay request for processes in a task namespace to the Subhurd's proc server. * proc/pgrp.c (S_proc_getsid): Likewise. Translate PIDs. (S_proc_getsessionpids): Likewise. (S_proc_getsessionpgids): Likewise. (S_proc_getpgrppids): Likewise. * proc/proc.h (namespace_is_subprocess): New prototype. (namespace_translate_pids): Likewise.
2015-03-05Fix space styleSamuel Thibault
2013-11-09proc: fix a use-after-free errorJustus Winter
If we have to create a new process group, we have to do this before leaving the current one. The current process group is deallocated if the process is the last process in that group. Likewise, if the current group was the last group in the current groups session, the session is deallocated. Found using the Clang Static Analyzer. * proc/pgrp.c (S_proc_setpgrp): Fix use-after-free error.
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.
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-04-152000-04-03 Neal H Walfield <neal@cs.uml.edu>Roland McGrath
* 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. * 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.
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.
1996-05-30(S_proc_getsidport): MAKE_SEND_ONCE -> MAKE_SEND.Michael I. Bushnell
1996-04-25 Many changes to support multi-threading. See ChangeLog.Michael I. Bushnell
1996-03-20(S_proc_setpgrp): Delete bletcherous hack from July 22, 1995.Michael I. Bushnell
1995-12-21(free_session): Correctly get rid of the receive right we're holding.Miles Bader
(S_proc_getsidport): Add and use new arg sessport_type. Return errors.
1995-07-22(S_proc_setpgrp): Install bletcherous hack.Michael I. Bushnell
1995-01-19More of same.Roland McGrath
1995-01-19(S_proc_setpgrp): Use nowait_msg_proc_newids instead of nowait_proc_newids.Roland McGrath
1994-08-23entered into RCSMichael I. Bushnell
1994-08-22Formerly pgrp.c.~12~Roland McGrath
1994-08-19Formerly pgrp.c.~11~Michael I. Bushnell
1994-08-19Formerly pgrp.c.~10~Michael I. Bushnell
1994-08-19Formerly pgrp.c.~9~Roland McGrath
1994-07-22Formerly pgrp.c.~8~Michael I. Bushnell
1994-07-11Formerly pgrp.c.~7~Michael I. Bushnell
1994-06-30Formerly pgrp.c.~6~Michael I. Bushnell
1994-05-06Formerly pgrp.c.~5~Michael I. Bushnell
1994-04-07Formerly pgrp.c.~4~Michael I. Bushnell
1994-04-05Formerly pgrp.c.~3~Michael I. Bushnell
1994-03-22Formerly pgrp.c.~2~Michael I. Bushnell
1994-03-22Initial revisionMichael I. Bushnell