Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.2 KB
|
Rev | Line | |
---|
[444] | 1 | #ifndef _SHARED_WAIT_H_ |
---|
| 2 | #define _SHARED_WAIT_H_ |
---|
| 3 | |
---|
| 4 | /********************************************************************************************* |
---|
| 5 | * These macros can be used by the parent process to analyze a child process |
---|
| 6 | * termination status, as returned by the wait() syscall. |
---|
| 7 | * The termination state is a 32 bits word: |
---|
| 8 | * - the 8 LSB bits contain the user defined exit status |
---|
| 9 | * - the 24 other bits contain the flags defined below |
---|
| 10 | ********************************************************************************************/ |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | #define PROCESS_TERM_STOP 0x100 /*! process received a SIGSTOP signal */ |
---|
| 14 | #define PROCESS_TERM_KILL 0x200 /*! process killed by a SIGKILL signal */ |
---|
| 15 | #define PROCESS_TERM_EXIT 0x400 /*! process terminated by a sys_exit() */ |
---|
| 16 | #define PROCESS_TERM_WAIT 0x800 /*! parent process executed a sys_wait() */ |
---|
| 17 | |
---|
| 18 | #define WIFEXITED( status ) (status & PROCESS_TERM_EXIT) |
---|
| 19 | #define WIFSIGNALED( status ) (status & PROCESS_TERM_KILL) |
---|
| 20 | #define WIFSTOPPED( status ) (status & PROCESS_TERM_STOP) |
---|
| 21 | #define WEXITSTATUS( status ) (status & 0xFF) |
---|
| 22 | |
---|
| 23 | #define WNOHANG -1 // TODO Not in almos-mkh |
---|
| 24 | |
---|
| 25 | #endif |
---|
| 26 | |
---|
Note: See
TracBrowser
for help on using the repository browser.