wait.h 748 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <Kernel/API/POSIX/sys/types.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #define WEXITSTATUS(status) (((status)&0xff00) >> 8)
  12. #define WSTOPSIG(status) WEXITSTATUS(status)
  13. #define WTERMSIG(status) ((status)&0x7f)
  14. #define WIFEXITED(status) (WTERMSIG(status) == 0)
  15. #define WIFSTOPPED(status) (((status)&0xff) == 0x7f)
  16. #define WIFSIGNALED(status) (((char)(((status)&0x7f) + 1) >> 1) > 0)
  17. #define WNOHANG 1
  18. #define WUNTRACED 2
  19. #define WSTOPPED WUNTRACED
  20. #define WEXITED 4
  21. #define WCONTINUED 8
  22. #define WNOWAIT 0x1000000
  23. typedef enum {
  24. P_ALL = 1,
  25. P_PID,
  26. P_PGID
  27. } idtype_t;
  28. #ifdef __cplusplus
  29. }
  30. #endif