wait.h 989 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _SYS_WAIT_H
  2. #define _SYS_WAIT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <sys/types.h>
  7. #define WNOHANG 1
  8. #define WUNTRACED 2
  9. /* A status looks like:
  10. <1 byte info> <1 byte code>
  11. <code> == 0, child has exited, info is the exit value
  12. <code> == 1..7e, child has exited, info is the signal number.
  13. <code> == 7f, child has stopped, info was the signal number.
  14. <code> == 80, there was a core dump.
  15. */
  16. #define WIFEXITED(w) (((w) & 0xff) == 0)
  17. #define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
  18. #define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
  19. #define WEXITSTATUS(w) (((w) >> 8) & 0xff)
  20. #define WTERMSIG(w) ((w) & 0x7f)
  21. #define WSTOPSIG WEXITSTATUS
  22. pid_t wait (int *);
  23. pid_t waitpid (pid_t, int *, int);
  24. #ifdef _COMPILING_NEWLIB
  25. pid_t _wait (int *);
  26. #endif
  27. /* Provide prototypes for most of the _<systemcall> names that are
  28. provided in newlib for some compilers. */
  29. pid_t _wait (int *);
  30. #ifdef __cplusplus
  31. };
  32. #endif
  33. #endif