home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntinc25.zoo / wait.h < prev    next >
C/C++ Source or Header  |  1992-10-18  |  852b  |  48 lines

  1. #ifndef _WAIT_H
  2. #define _WAIT_H
  3.  
  4. #ifndef _COMPILER_H
  5. #include <compiler.h>
  6. #endif
  7.  
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. struct __wait {
  13. #ifndef __MSHORT__
  14.     unsigned    junk:16;    /* padding to make it 32 bits */
  15. #endif
  16.     unsigned    retcode:8;
  17.     unsigned    coredump:1;
  18.     unsigned    termsig:7;
  19. };
  20.  
  21. union wait {
  22.     struct __wait     _w;
  23.     int        _i;
  24. };
  25.  
  26. #define w_termsig    _w.termsig
  27. #define w_stopsig    _w.retcode
  28. #define w_coredump    _w.coredump
  29. #define w_retcode    _w.retcode
  30.  
  31. /* I don't know if this next one is right or not */
  32. #define w_status    _i
  33.  
  34. #define WSTOPPED    0177    /* fake "signal" for stopped processes */
  35.  
  36. #define WIFSIGNALED(x)    ((x)._w.termsig != 0)
  37. #define WIFSTOPPED(x)    ((x)._w.termsig == WSTOPPED)
  38. #define WIFEXITED(x)    ((x)._w.termsig == 0)
  39.  
  40. #define WNOHANG        1
  41. #define WUNTRACED    2
  42.  
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46.  
  47. #endif
  48.