aboutsummaryrefslogtreecommitdiff
path: root/proc/pgrp.c
Commit message (Collapse)AuthorAgeFilesLines
* proc: Port to x86_64Sergey Bugaev2023-05-101-3/+3
| | | | Message-Id: <20230508213136.608575-18-bugaevc@gmail.com>
* proc: Fix variable typeSamuel Thibault2022-01-201-4/+4
| | | | Reported-by: Etienne Brateau <etienne.brateau@gmail.com>
* proc: send signals with POSIX sigcodesJeremie Koenig2020-12-271-2/+2
| | | | | | | | * proc/stubs.c (send_signal): Add a sigcode argument. * proc/proc.h (send_signal): Declare the sigcode argument. * proc/pgrp.c (leave_pgrp): Specify a null sigcode. * proc/wait.c (alert_parent): Use CLD_EXITED for SIGCHLD on exit. (S_proc_mark_stop): Use CLD_STOPPED for SIGCHLD on stop.
* Use our own variant of 'assert' and 'assert_perror'.Justus Winter2017-08-051-2/+2
| | | | | Our variants print stack traces on failures. This will make locating errors much easier.
* proc: Hierarchical proc servers.Justus Winter2017-03-111-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix space styleSamuel Thibault2015-03-051-12/+12
|
* proc: fix a use-after-free errorJustus Winter2013-11-091-1/+7
| | | | | | | | | | | | 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.
* proc: add proc_mark_important server codeJustus Winter2013-08-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-07 Roland McGrath <roland@frob.com>Roland McGrath2002-05-081-36/+36
| | | | | | | | * 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.
* 2000-04-03 Neal H Walfield <neal@cs.uml.edu>Roland McGrath2001-04-151-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-09 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell1999-07-111-7/+7
| | | | | | | | | | * 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.
* (S_proc_getsidport): MAKE_SEND_ONCE -> MAKE_SEND.Michael I. Bushnell1996-05-301-1/+1
|
* Many changes to support multi-threading. See ChangeLog.Michael I. Bushnell1996-04-251-1/+23
|
* (S_proc_setpgrp): Delete bletcherous hack from July 22, 1995.Michael I. Bushnell1996-03-201-16/+6
|
* (free_session): Correctly get rid of the receive right we're holding.Miles Bader1995-12-211-6/+8
| | | | (S_proc_getsidport): Add and use new arg sessport_type. Return errors.
* (S_proc_setpgrp): Install bletcherous hack.Michael I. Bushnell1995-07-221-5/+15
|
* More of same.Roland McGrath1995-01-191-4/+5
|
* (S_proc_setpgrp): Use nowait_msg_proc_newids instead of nowait_proc_newids.Roland McGrath1995-01-191-3/+3
|
* entered into RCSMichael I. Bushnell1994-08-231-0/+3
|
* Formerly pgrp.c.~12~Roland McGrath1994-08-221-1/+1
|
* Formerly pgrp.c.~11~Michael I. Bushnell1994-08-191-4/+9
|
* Formerly pgrp.c.~10~Michael I. Bushnell1994-08-191-7/+18
|
* Formerly pgrp.c.~9~Roland McGrath1994-08-191-2/+7
|
* Formerly pgrp.c.~8~Michael I. Bushnell1994-07-221-2/+2
|
* Formerly pgrp.c.~7~Michael I. Bushnell1994-07-111-0/+4
|
* Formerly pgrp.c.~6~Michael I. Bushnell1994-06-301-8/+17
|
* Formerly pgrp.c.~5~Michael I. Bushnell1994-05-061-9/+9
|
* Formerly pgrp.c.~4~Michael I. Bushnell1994-04-071-4/+1
|
* Formerly pgrp.c.~3~Michael I. Bushnell1994-04-051-1/+4
|
* Formerly pgrp.c.~2~Michael I. Bushnell1994-03-221-13/+77
|
* Initial revisionMichael I. Bushnell1994-03-221-0/+313