POSIX declarations for waiting (<sys/wait.h>)
More...
#include <signal.h>
#include <sys/types.h>
#include <zephyr/kernel.h>
Go to the source code of this file.
|
| #define | WCONTINUED K_PROCESS_WCONTINUED |
| | Report status of any continued child process.
|
| |
| #define | WNOHANG K_PROCESS_WNOHANG |
| | Do not hang if no status is available; return immediately.
|
| |
| #define | WUNTRACED K_PROCESS_WUNTRACED |
| | Report status of stopped child process.
|
| |
| #define | WEXITSTATUS(wstatus) K_WEXITSTATUS(wstatus) |
| | Exit status of a child that exited normally.
|
| |
| #define | WIFCONTINUED(wstatus) ((wstatus) == 0xffff) |
| | True if the child has continued from a job control stop.
|
| |
| #define | WIFEXITED(wstatus) K_WIFEXITED(wstatus) |
| | True if the child exited normally.
|
| |
| #define | WIFSIGNALED(wstatus) K_WIFSIGNALED(wstatus) |
| | True if the child exited due to an uncaught signal.
|
| |
| #define | WIFSTOPPED(wstatus) (((wstatus) & 0xff) == 0x7f) |
| | True if the child is currently stopped.
|
| |
| #define | WSTOPSIG(wstatus) (((wstatus) >> 8) & 0xff) |
| | Signal number that caused the child to stop.
|
| |
| #define | WTERMSIG(wstatus) K_WTERMSIG(wstatus) |
| | Signal number that caused the child to terminate.
|
| |
| #define | WEXITED K_PROCESS_WEXITED |
| | Wait for processes that have exited.
|
| |
| #define | WNOWAIT K_PROCESS_WNOWAIT |
| | Report the status of a selected process, leaving it waitable.
|
| |
| #define | WSTOPPED K_PROCESS_WUNTRACED |
| | Wait for processes stopped by delivery of a signal.
|
| |
POSIX declarations for waiting (<sys/wait.h>)
- See also
- POSIX.1-2017 <sys/wait.h>
Definition in file wait.h.
◆ WCONTINUED
| #define WCONTINUED K_PROCESS_WCONTINUED |
Report status of any continued child process.
Definition at line 33 of file wait.h.
◆ WEXITED
| #define WEXITED K_PROCESS_WEXITED |
Wait for processes that have exited.
Definition at line 58 of file wait.h.
◆ WEXITSTATUS
| #define WEXITSTATUS |
( |
|
wstatus | ) |
K_WEXITSTATUS(wstatus) |
Exit status of a child that exited normally.
Definition at line 41 of file wait.h.
◆ WIFCONTINUED
| #define WIFCONTINUED |
( |
|
wstatus | ) |
((wstatus) == 0xffff) |
True if the child has continued from a job control stop.
Definition at line 44 of file wait.h.
◆ WIFEXITED
| #define WIFEXITED |
( |
|
wstatus | ) |
K_WIFEXITED(wstatus) |
True if the child exited normally.
Definition at line 47 of file wait.h.
◆ WIFSIGNALED
| #define WIFSIGNALED |
( |
|
wstatus | ) |
K_WIFSIGNALED(wstatus) |
True if the child exited due to an uncaught signal.
Definition at line 49 of file wait.h.
◆ WIFSTOPPED
| #define WIFSTOPPED |
( |
|
wstatus | ) |
(((wstatus) & 0xff) == 0x7f) |
True if the child is currently stopped.
Definition at line 51 of file wait.h.
◆ WNOHANG
| #define WNOHANG K_PROCESS_WNOHANG |
Do not hang if no status is available; return immediately.
Definition at line 36 of file wait.h.
◆ WNOWAIT
| #define WNOWAIT K_PROCESS_WNOWAIT |
Report the status of a selected process, leaving it waitable.
Definition at line 60 of file wait.h.
◆ WSTOPPED
| #define WSTOPPED K_PROCESS_WUNTRACED |
Wait for processes stopped by delivery of a signal.
Definition at line 62 of file wait.h.
◆ WSTOPSIG
| #define WSTOPSIG |
( |
|
wstatus | ) |
(((wstatus) >> 8) & 0xff) |
Signal number that caused the child to stop.
Definition at line 53 of file wait.h.
◆ WTERMSIG
| #define WTERMSIG |
( |
|
wstatus | ) |
K_WTERMSIG(wstatus) |
Signal number that caused the child to terminate.
Definition at line 55 of file wait.h.
◆ WUNTRACED
| #define WUNTRACED K_PROCESS_WUNTRACED |
Report status of stopped child process.
Definition at line 38 of file wait.h.
◆ id_t
◆ idtype_t
Identifier kind selecting the scope of a waitid() operation.
◆ pid_t
◆ idtype
Identifier kind selecting the scope of a waitid() operation.
| Enumerator |
|---|
| P_ALL | Wait for any child of the calling process.
|
| P_PID | Wait for the child with a specific process ID.
|
| P_PGID | Wait for any child in a specific process group.
|
Definition at line 66 of file wait.h.
◆ wait()
| pid_t wait |
( |
int * |
stat_loc | ) |
|
◆ waitid()
◆ waitpid()
| pid_t waitpid |
( |
pid_t |
pid, |
|
|
int * |
stat_loc, |
|
|
int |
options |
|
) |
| |
Wait for a child process to terminate.
- Parameters
-
| pid | child selection: a process ID, -1 for any child, 0 for the caller's process group, or a negated process group ID. |
| [out] | stat_loc | location in which to store the child's wait status; may be NULL. |
| options | bitwise OR of WNOHANG and WUNTRACED. |
- Returns
- the process ID of the child on success, or -1 with errno set on failure.
- See also
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html