wait.h 798 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 WIFCONTINUED(status) ((status) == 0xffff)
  18. #define WNOHANG 1
  19. #define WUNTRACED 2
  20. #define WSTOPPED WUNTRACED
  21. #define WEXITED 4
  22. #define WCONTINUED 8
  23. #define WNOWAIT 0x1000000
  24. typedef enum {
  25. P_ALL = 1,
  26. P_PID,
  27. P_PGID
  28. } idtype_t;
  29. #ifdef __cplusplus
  30. }
  31. #endif