home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / wait.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.6 KB  |  100 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_WAIT_H
  11. #define _SYS_WAIT_H
  12.  
  13. #include <sys/types.h>
  14. #include <sys/siginfo.h>
  15. #if !defined(_POSIX_SOURCE) 
  16. #include <sys/procset.h>
  17. #endif /* !defined(_POSIX_SOURCE) */
  18.  
  19.  
  20. #ident    "@(#)/usr/include/sys/wait.h.sl 1.1 4.0 12/08/90 8236 AT&T-USL"
  21.  
  22. /*
  23.  * arguments to wait functions
  24.  */
  25.  
  26. #if !defined(_POSIX_SOURCE) 
  27. #define WEXITED        0001    /* wait for processes that have exited    */
  28. #define WTRAPPED    0002    /* wait for processes stopped while tracing */
  29. #define WSTOPPED    0004    /* wait for processes stopped by signals */
  30. #define WCONTINUED    0010    /* wait for processes continued */
  31. #endif /* !defined(_POSIX_SOURCE) */
  32.  
  33. #define WUNTRACED    0004    /* for POSIX */
  34.  
  35. #define WNOHANG        0100    /* non blocking form of wait    */
  36.  
  37. #if !defined(_POSIX_SOURCE) 
  38. #define WNOWAIT        0200    /* non destructive form of wait */
  39.  
  40. #define WOPTMASK    (WEXITED|WTRAPPED|WSTOPPED|WCONTINUED|WNOHANG|WNOWAIT)
  41.  
  42. /*
  43.  * macros for stat return from wait functions
  44.  */
  45.  
  46. #define WCONTFLG        0177777
  47. #define WCOREFLG        0200
  48.  
  49. #define WWORD(stat)        ((int)((stat))&0177777)
  50. #endif /* !defined(_POSIX_SOURCE) */
  51.  
  52. #if !defined(_POSIX_SOURCE) 
  53. #define WSTOPFLG        0177
  54. #define WSIGMASK        0177
  55. #define WLOBYTE(stat)        ((int)((stat)&0377))
  56. #define WHIBYTE(stat)        ((int)(((stat)>>8)&0377))
  57. #endif /* !defined(_POSIX_SOURCE) */ 
  58.  
  59. #define WIFEXITED(stat)        (((int)((stat)&0377))==0)
  60. #define WIFSIGNALED(stat)    (((int)((stat)&0377))>0&&((int)(((stat)>>8)&0377))==0)
  61. #define WIFSTOPPED(stat)    (((int)((stat)&0377))==0177&&((int)(((stat)>>8)&0377))!=0)
  62.  
  63. #if !defined(_POSIX_SOURCE) 
  64. #define WIFCONTINUED(stat)    (WWORD(stat)==WCONTFLG)
  65. #endif /* !defined(_POSIX_SOURCE) */
  66.  
  67. #define WEXITSTATUS(stat)    ((int)(((stat)>>8)&0377))
  68. #define WTERMSIG(stat)        (((int)((stat)&0377))&0177)
  69. #define WSTOPSIG(stat)        ((int)(((stat)>>8)&0377))
  70.  
  71. #if !defined(_POSIX_SOURCE) 
  72. #define WCOREDUMP(stat)        ((stat)&WCOREFLG)
  73. #endif /* !defined(_POSIX_SOURCE) */
  74.  
  75.  
  76.  
  77. #if !defined(_KERNEL)
  78. #if defined(__STDC__)
  79.  
  80. extern pid_t wait(int *);
  81. extern pid_t waitpid(pid_t, int *, int);
  82.  
  83. #if !defined(_POSIX_SOURCE) 
  84. extern int waitid(idtype_t, id_t, siginfo_t *, int);
  85. #endif /* !defined(_POSIX_SOURCE) */
  86.  
  87. #else
  88.  
  89. extern pid_t wait();
  90. extern pid_t waitpid();
  91.  
  92. #if !defined(_POSIX_SOURCE) 
  93. extern int waitid();
  94. #endif /* !defined(_POSIX_SOURCE) */
  95.  
  96. #endif    /* __STDC__ */
  97. #endif    /* _KERNEL */
  98.  
  99. #endif    /* _SYS_WAIT_H */
  100.