Expand description
Low-level process management primitives.
Safe wrappers around fork, setsid, setpgid, dup2, prctl,
and fd-range close — building blocks for double-fork supervisor patterns.
Enums§
- Fork
Result - Result of a
forkcall.
Functions§
- close_
fds_ from - Close all file descriptors >=
start. - fork⚠
- Fork the current process.
- redirect_
fd_ ⚠to - Duplicate
src_fdontodst_fdand closesrc_fd. - redirect_
stdio_ ⚠to_ devnull - Redirect stdin, stdout, and stderr to
/dev/null. - set_
pdeathsig - Set the signal sent to this process when its parent dies (
PR_SET_PDEATHSIG). - setgid
- Drop process privileges to the given GID (
setresgid). - setpgid
- Set the process group ID of
pidtopgid(use 0 for self). - setsid
- Create a new session and set the calling process as leader.
- setuid
- Drop process privileges to the given UID (
setresuid).