📄 wait.h
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
include/sys/wait.h
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
02500 /* The <sys/wait.h> header contains macros related to wait(). The value
02501 * returned by wait() and waitpid() depends on whether the process
02502 * terminated by an exit() call, was killed by a signal, or was stopped
02503 * due to job control, as follows:
02504 *
02505 * High byte Low byte
02506 * +---------------------+
02507 * exit(status) | status | 0 |
02508 * +---------------------+
02509 * killed by signal | 0 | signal |
02510 * +---------------------+
02511 * stopped (job control) | signal | 0177 |
02512 * +---------------------+
02513 */
02514
02515 #ifndef _WAIT_H
02516 #define _WAIT_H
02517
02518 #define _LOW(v) ( (v) & 0377)
02519 #define _HIGH(v) ( ((v) >> 8) & 0377)
02520
02521 #define WNOHANG 1 /* do not wait for child to exit */
02522 #define WUNTRACED 2 /* for job control; not implemented */
02523
02524 #define WIFEXITED(s) (_LOW(s) == 0) /* normal exit */
02525 #define WEXITSTATUS(s) (_HIGH(s)) /* exit status */
02526 #define WTERMSIG(s) (_LOW(s) & 0177) /* sig value */
02527 #define WIFSIGNALED(s) (((unsigned int)(s)-1 & 0xFFFF) < 0xFF) /* signaled */
02528 #define WIFSTOPPED(s) (_LOW(s) == 0177) /* stopped */
02529 #define WSTOPSIG(s) (_HIGH(s) & 0377) /* stop signal */
02530
02531 /* Function Prototypes. */
02532 #ifndef _ANSI_H
02533 #include <ansi.h>
02534 #endif
02535
02536 _PROTOTYPE( pid_t wait, (int *_stat_loc) );
02537 _PROTOTYPE( pid_t waitpid, (pid_t _pid, int *_stat_loc, int _options) );
02538
02539 #endif /* _WAIT_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -