The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/sys/wait.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* The <sys/wait.h> header contains macros related to wait(). The value
    2  * returned by wait() and waitpid() depends on whether the process 
    3  * terminated by an exit() call, was killed by a signal, or was stopped
    4  * due to job control, as follows:
    5  *
    6  *                               High byte   Low byte
    7  *                              +---------------------+
    8  *      exit(status)            |  status  |    0     |
    9  *                              +---------------------+
   10  *      killed by signal        |    0     |  signal  |
   11  *                              +---------------------+
   12  *      stopped (job control)   |  signal  |   0177   |
   13  *                              +---------------------+
   14  */
   15 
   16 #ifndef _WAIT_H
   17 #define _WAIT_H
   18 
   19 #ifndef _TYPES_H
   20 #include <sys/types.h>
   21 #endif
   22 
   23 #define _LOW(v)         ( (v) & 0377)
   24 #define _HIGH(v)        ( ((v) >> 8) & 0377)
   25 
   26 #define WNOHANG         1       /* do not wait for child to exit */
   27 #define WUNTRACED       2       /* for job control; not implemented */
   28 
   29 #define WIFEXITED(s)    (_LOW(s) == 0)                      /* normal exit */
   30 #define WEXITSTATUS(s)  (_HIGH(s))                          /* exit status */
   31 #define WTERMSIG(s)     (_LOW(s) & 0177)                    /* sig value */
   32 #define WIFSIGNALED(s)  (((unsigned int)(s)-1 & 0xFFFF) < 0xFF) /* signaled */
   33 #define WIFSTOPPED(s)   (_LOW(s) == 0177)                   /* stopped */
   34 #define WSTOPSIG(s)     (_HIGH(s) & 0377)                   /* stop signal */
   35 
   36 /* Function Prototypes. */
   37 _PROTOTYPE( pid_t wait, (int *_stat_loc)                                   );
   38 _PROTOTYPE( pid_t waitpid, (pid_t _pid, int *_stat_loc, int _options)      );
   39 
   40 #endif /* _WAIT_H */

Cache object: a89a17bd927b54f40a18874de25072b4


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.