sys_wait.h(0P)
π sys_wait.h(0P) π
okay bestie, welcome to the POSIX Programmer's Manual β this lil page is literally titled sys_wait.h(0P) and it's all about the header that handles waiting. iykyk, it's the one your shell is silently screaming into every time a child process does something.
β¨ PROLOG β¨
so like, real talk first π«Ά β this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may be different (so pls go check the corresponding Linux manual page for the deets on Linux behavior), or honestly? the interface might not even be implemented on Linux at all. no cap. π
πΈ NAME πΈ
sys/wait.h β declarations for waiting. that's it. that's the vibe. it declares the stuff you need so you can sit there and wait for your children (processes, bestie, processes π).
π SYNOPSIS π
#include <sys/wait.h>
π DESCRIPTION π
okay so the <sys/wait.h> header shall define these symbolic constants for use with waitpid():
WCONTINUEDβ report the status of a continued child process β¨WNOHANGβ do not hang if there's no status available; just return immediately, she's busy πWUNTRACEDβ report the status of a stopped child process
and the <sys/wait.h> header shall define these macros for analyzing process status values (the little decoder ring of process feelings π):
WEXITSTATUSβ return exit statusWIFCONTINUEDβ true if the child has been continuedWIFEXITEDβ true if the child exited normallyWIFSIGNALEDβ true if the child exited due to an uncaught signal πWIFSTOPPEDβ true if the child is currently stoppedWSTOPSIGβ return the signal number that caused the process to stopWTERMSIGβ return the signal number that caused the process to terminate π
and 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 stateWSTOPPEDβ status is returned for any child that has stopped upon receipt of a signal
and psst, the WCONTINUED and WNOHANG constants that we described above for waitpid()? yeah, those can also be used with waitid(). two-for-one deal, we love to see it π₯
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 β main character enum energy fr fr π
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>.
heads up: including 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. (yes, all of them, we're not skipping anything bestie π)
pid_t wait(int *);
int waitid(idtype_t, id_t, siginfo_t *, int);
pid_t waitpid(pid_t, int *, int);
and just so you know: the following sections are informative. (translation: they're the chill ones, not the rule-making ones π)
π· APPLICATION USAGE π·
None. literally nothing. empty. a void. she said nothing and meant it π«Ά
π¦ RATIONALE π¦
None. also nothing. iconic silence honestly β¨
π FUTURE DIRECTIONS π
None. no future plans, just vibes π§
π SEE ALSO π
<signal.h><sys_resource.h><sys_types.h>
and the System Interfaces volume of POSIX.1β2017, wait(), waitid() β go read those, they're the whole point bestie π
π COPYRIGHT π
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 .
okay that's the whole page, bestie, we ate and left no crumbs π β¨
this masterpiece was served to you by IEEE/The Open Group, dated 2017, under the name sys_wait.h(0P). periodt. πππΈ
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms