sys_wait.h(7POSIX)
πΈ sys_wait.h β the POSIX Programmer's Manual era π
okay bestie, so this is sys_wait.h(7POSIX), straight out of the POSIX Programmer's Manual. it's the header that handles all your waiting drama. let's get into it π«Ά
β¨ PROLOG β¨
okay so first thing, real talk: this manual page is part of the POSIX Programmer's Manual. but β and this is important β the Linux implementation of this interface may differ. so if you're on Linux, go consult the corresponding Linux manual page for the details of Linux behavior. or honestly? the interface may just not be implemented on Linux at all. vibe check accordingly π
π NAME π
sys/wait.h β declarations for waiting π
π SYNOPSIS π
#include <sys/wait.h>
that's it. one include. slay.
π DESCRIPTION π
okay so the <sys/wait.h> header shall define the following symbolic constants for use with waitpid():
WCONTINUEDβ report status of a continued child process π¦WNOHANGβ do not hang if no status is available; return immediately β‘WUNTRACEDβ report status of a stopped child process π
and then the header shall define these macros for analysis of process status values:
WEXITSTATUSβ return exit statusWIFCONTINUEDβ true if child has been continuedWIFEXITEDβ true if child exited normallyWIFSIGNALEDβ true if child exited due to uncaught signalWIFSTOPPEDβ true if child is currently stoppedWSTOPSIGβ return signal number that caused process to stopWTERMSIGβ return signal number that caused process to terminate
then the <sys/wait.h> header shall define these symbolic constants as possible values for the options argument to waitid():
WEXITEDβ wait for processes that have exitedWNOWAITβ keep the process whose status is returned in infop in a waitable state πWSTOPPEDβ status is returned for any child that has stopped upon receipt of a signal
and listen β the WCONTINUED and WNOHANG constants described above for waitpid() can also be used with waitid(). multi-purpose icons fr fr β¨
the type idtype_t shall be defined as an enumeration type whose possible values shall include at least the following: P_ALL P_PGID P_PID
the <sys/wait.h> header shall define the id_t and pid_t types as described in <sys/types.h>.
the <sys/wait.h> header shall define the siginfo_t type and the sigval union as described in <signal.h>.
also, inclusion of the <sys/wait.h> header may also make visible all symbols from <signal.h>. surprise bonus content π
the following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.
pid_t wait(int *);
int waitid(idtype_t, id_t, siginfo_t *, int);
pid_t waitpid(pid_t, int *, int);
and then β the following sections are informative. (so like, notes, not rules π )
π APPLICATION USAGE π
None.
like, literally none. nothing to add. iconic minimalism.
π§ RATIONALE π§
None.
again β none. they said what they said.
β FUTURE DIRECTIONS β
None.
no plans. no changes. we're staying exactly as we are, bestie. periodt.
π₯ SEE ALSO π₯
<signal.h><sys_resource.h><sys_types.h>
and also: the System Interfaces volume of POSIX.1β2017, wait(), waitid() π«Ά
π COPYRIGHT π
okay so legal bit, and I'm keeping every word because rules are rules:
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
heads up bestie: if you spot a typo in here, it's almost definitely a conversion glitch, not the original. report it at the link above instead of fighting for your life in the group chat π
and that's the whole page!! brought to you by IEEE/The Open Group, 2017 π the sys_wait.h(7POSIX) girly herself. go forth and wait on your children processes responsibly, bestie. no cap, you ate this. πππ¦
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms