Annotation of mstools/posix/h/sys/wait.h, revision 1.1.1.2

1.1       root        1: /*++
                      2: 
                      3: Copyright (c) 1989  Microsoft Corporation
                      4: 
                      5: Module Name:
                      6: 
                      7:    wait.h
                      8: 
                      9: Abstract:
                     10: 
                     11:    This module contains the symbolic constants, macros, and structures needed to
                     12:    support wait, waitpid, and _exit in in IEEE P1003.1/Draft 13.
                     13: 
                     14: --*/
                     15: 
                     16: #ifndef _SYS_WAIT_
                     17: #define _SYS_WAIT_
                     18: 
1.1.1.2 ! root       19: #ifdef __cplusplus
        !            20: extern "C" {
        !            21: #endif
        !            22: 
1.1       root       23: /*
                     24:  * wait options
                     25:  */
                     26: 
                     27: #define WNOHANG   0x00000001
                     28: #define WUNTRACED 0x00000002
                     29: 
                     30: /*
                     31:  * Structure of wait status value
                     32:  *
                     33:  *    Bit 32 - 0 if process terminated normally
                     34:  *             1 if process was signaled
                     35:  *    Bit 31 - 0 if process is not stopped
                     36:  *             1 if process is stopped
                     37:  *    Bits 0-7 exit status or signal number
                     38:  */
                     39: 
                     40: /*
                     41:  * Evaluate to non-zero if process terminated normally (by calling _exit)
                     42:  */
                     43: 
1.1.1.2 ! root       44: #define WIFEXITED(stat_val)    \
        !            45:        (((stat_val) & 0xff) == 0)
1.1       root       46: 
                     47: /*
                     48:  * Returns the low-order 8 bits of the status argument passed to _exit
                     49:  */
                     50: 
1.1.1.2 ! root       51: #define WEXITSTATUS(stat_val)  \
        !            52:        (((stat_val) & 0xff00) >> 8)
1.1       root       53: 
                     54: /*
                     55:  * Evaluate to non-zero if process terminated due to receipt of a signal
                     56:  * that was not caught
                     57:  */
                     58: 
1.1.1.2 ! root       59: #define WIFSIGNALED(stat_val)  \
        !            60:        (!WIFSTOPPED(stat_val) && !WIFEXITED(stat_val))
1.1       root       61: 
                     62: /*
                     63:  * Returns the signal number of the signal that caused the process to terminate
                     64:  */
                     65: 
1.1.1.2 ! root       66: #define WTERMSIG(stat_val)     \
        !            67:        ((stat_val) & 0xff)
1.1       root       68: 
                     69: /*
                     70:  * Evaluate to non-zero if process is currently stopped
                     71:  */
                     72: 
1.1.1.2 ! root       73: #define WIFSTOPPED(stat_val)   \
        !            74:        (((stat_val) & 0xff) == 0177)
1.1       root       75: 
                     76: /*
                     77:  * Returns the signal number of the signal that caused the process to stop
                     78:  */
                     79: 
1.1.1.2 ! root       80: #define WSTOPSIG(stat_val)     \
        !            81:        (((stat_val) & 0xff00) >> 8)
1.1       root       82: 
                     83: pid_t _CRTAPI1 wait(int *);
                     84: pid_t _CRTAPI1 waitpid(pid_t, int *, int);
                     85: 
1.1.1.2 ! root       86: #ifdef __cplusplus
        !            87: }
        !            88: #endif
        !            89: 
1.1       root       90: #endif /* _SYS_WAIT_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.