home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / vx-share / wait.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-12  |  1.3 KB  |  47 lines

  1. /* wait.h - header file for remote wait call */
  2.  
  3. /*  Copyright 1992 Free Software Foundation, Inc.
  4.  
  5.     This code was donated by Wind River Systems, Inc. */
  6.  
  7. /*
  8. modification history
  9. --------------------
  10. 01a,05jun90,llk  borrowed.
  11. */
  12.  
  13. /* Define how to access the structure that the wait system call stores.
  14.    On many systems, there is a structure defined for this.
  15.    But on vanilla-ish USG systems there is not.  */
  16.  
  17. #ifndef HAVE_WAIT_STRUCT
  18. #define WAITTYPE int
  19. #define WIFSTOPPED(w) (((w)&0377) == 0177)
  20. #define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
  21. #define WIFEXITED(w) (((w)&0377) == 0)
  22. #define WRETCODE(w) ((w) >> 8)
  23. #define WSTOPSIG(w) ((w) >> 8)
  24. #define WCOREDUMP(w) (((w)&0200) != 0)
  25. #define WTERMSIG(w) ((w) & 0177)
  26. #define WSETEXIT(w, status) ((w) = (status))
  27. #define WSETSTOP(w,sig)  ((w) = (0177 | ((sig) << 8)))
  28. #else
  29. #if FALSE
  30. #ifndef ORIG
  31.  
  32. /* don't include sys/wait.h */
  33.  
  34. #else ORIG
  35. #include <sys/wait.h>
  36. #endif ORIG
  37. #endif FALSE
  38. #define WAITTYPE union wait
  39. #define WRETCODE(w) (w).w_retcode
  40. #define WSTOPSIG(w) (w).w_stopsig
  41. #define WCOREDUMP(w) (w).w_coredump
  42. #define WTERMSIG(w) (w).w_termsig
  43. #define WSETEXIT(w, status) ((w).w_status = (status))
  44. #define WSETSTOP(w,sig)  \
  45.   ((w).w_stopsig = (sig), (w).w_coredump = 0, (w).w_termsig = 0177)
  46. #endif
  47.