posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
wait.h
Go to the documentation of this file.
1/*
2 * Copyright The Zephyr Project Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
17#ifndef ZEPHYR_INCLUDE_POSIX_SYS_WAIT_H_
18#define ZEPHYR_INCLUDE_POSIX_SYS_WAIT_H_
19
20#include <signal.h>
21#include <sys/types.h>
22
23#include <zephyr/kernel.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#if defined(_POSIX_C_SOURCE) || defined(__DOXYGEN__)
30
31#if defined(_XOPEN_SOURCE) || defined(__DOXYGEN__)
33#define WCONTINUED K_PROCESS_WCONTINUED
34#endif
36#define WNOHANG K_PROCESS_WNOHANG
38#define WUNTRACED K_PROCESS_WUNTRACED
39
41#define WEXITSTATUS(wstatus) K_WEXITSTATUS(wstatus)
42#if defined(_XOPEN_SOURCE) || defined(__DOXYGEN__)
44#define WIFCONTINUED(wstatus) ((wstatus) == 0xffff)
45#endif
47#define WIFEXITED(wstatus) K_WIFEXITED(wstatus)
49#define WIFSIGNALED(wstatus) K_WIFSIGNALED(wstatus)
51#define WIFSTOPPED(wstatus) (((wstatus) & 0xff) == 0x7f)
53#define WSTOPSIG(wstatus) (((wstatus) >> 8) & 0xff)
55#define WTERMSIG(wstatus) K_WTERMSIG(wstatus)
56
58#define WEXITED K_PROCESS_WEXITED
60#define WNOWAIT K_PROCESS_WNOWAIT
62#define WSTOPPED K_PROCESS_WUNTRACED
63
64#if !defined(_IDTYPE_T_DECLARED) && !defined(__idtype_t_defined) || defined(__DOXYGEN__)
74#define _IDTYPE_T_DECLARED
75#define __idtype_t_defined
76#endif
77
78#if !defined(_ID_T_DECLARED) && !defined(__id_t_defined)
79typedef int id_t;
80#define _ID_T_DECLARED
81#define __id_t_defined
82#endif
83
84#if !defined(_PID_T_DECLARED) && !defined(__pid_t_defined)
85typedef int pid_t;
86#define _PID_T_DECLARED
87#define __pid_t_defined
88#endif
89
96pid_t wait(int *stat_loc);
97
107int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options);
108
118pid_t waitpid(pid_t pid, int *stat_loc, int options);
119
120#endif /* defined(_POSIX_C_SOURCE) || defined(__DOXYGEN__) */
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* ZEPHYR_INCLUDE_POSIX_SYS_WAIT_H_ */
int pid_t
Process ID type.
Definition fcntl.h:192
Information associated with a received signal.
POSIX fundamental types (<sys/types.h>)
int id_t
Used as a general identifier; can contain at least a pid_t, uid_t, or gid_t.
Definition types.h:82
pid_t waitpid(pid_t pid, int *stat_loc, int options)
Wait for a child process to terminate.
idtype
Identifier kind selecting the scope of a waitid() operation.
Definition wait.h:66
@ P_PGID
Wait for any child in a specific process group.
Definition wait.h:72
@ P_ALL
Wait for any child of the calling process.
Definition wait.h:68
@ P_PID
Wait for the child with a specific process ID.
Definition wait.h:70
pid_t wait(int *stat_loc)
Wait for any child process to terminate.
int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)
Wait for a child process matching idtype and id to change state.
enum idtype idtype_t
Identifier kind selecting the scope of a waitid() operation.