wait.pxd 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/wait.h.html
  2. from posix.types cimport pid_t, id_t
  3. from posix.signal cimport siginfo_t
  4. from posix.resource cimport rusage
  5. cdef extern from "<sys/wait.h>" nogil:
  6. enum: WNOHANG
  7. enum: WUNTRACED
  8. enum: WCONTINUED
  9. enum: WEXITED
  10. enum: WSTOPPED
  11. enum: WNOWAIT
  12. int WEXITSTATUS(int status)
  13. int WIFCONTINUED(int status)
  14. int WIFEXITED(int status)
  15. int WIFSIGNALED(int status)
  16. int WIFSTOPPED(int status)
  17. int WSTOPSIG(int status)
  18. int WTERMSIG(int status)
  19. ctypedef int idtype_t
  20. enum: P_ALL # idtype_t values
  21. enum: P_PID
  22. enum: P_PGID
  23. pid_t wait(int *stat_loc)
  24. pid_t waitpid(pid_t pid, int *status, int options)
  25. int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)
  26. # wait3 was in POSIX until 2008 while wait4 was never standardized.
  27. # Even so, these calls are in almost every Unix, always in sys/wait.h.
  28. # Hence, posix.wait is the least surprising place to declare them for Cython.
  29. # libc may require _XXX_SOURCE to be defined at C-compile time to provide them.
  30. pid_t wait3(int *status, int options, rusage *rusage)
  31. pid_t wait4(pid_t pid, int *status, int options, rusage *rusage)