From 7de831efc65993c44c9e87342a08f6a122250794 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 4 Aug 2020 13:51:11 +0200 Subject: Kernel+LibC: Add sys$disown() for disowning child processes This syscall allows a parent process to disown a child process, setting its parent PID to 0. Unparented processes are automatically reaped by the kernel upon exit, and no sys$waitid() is required. This will make it much nicer to do spawn-and-forget which is common in the GUI environment. --- Base/usr/share/man/man2/disown.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Base/usr/share/man/man2/disown.md (limited to 'Base') diff --git a/Base/usr/share/man/man2/disown.md b/Base/usr/share/man/man2/disown.md new file mode 100644 index 0000000000..8416029865 --- /dev/null +++ b/Base/usr/share/man/man2/disown.md @@ -0,0 +1,25 @@ +## Name + +disown - disown a child process + +## Synopsis + +```**c++ +#include + +int disown(pid_t pid); +``` + +## Description + +`disown()` unparents a child process of the calling process. The child's parent PID is set to zero, which allows the kernel to automatically reap it upon death. + +## Pledge + +In pledged programs, the `proc` promise is required for this system call. + +## Errors + +* `ESRCH`: No process with PID `pid` was found. +* `ECHILD`: The target process is not a child of the calling process. + -- cgit v1.2.3