Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
1.6 KiB

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