resource.pxd 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/resource.h.html
  2. from posix.time cimport timeval
  3. from posix.types cimport id_t
  4. cdef extern from "<sys/resource.h>" nogil:
  5. enum: PRIO_PROCESS
  6. enum: PRIO_PGRP
  7. enum: PRIO_USER
  8. enum: RLIM_INFINITY
  9. enum: RLIM_SAVED_MAX
  10. enum: RLIM_SAVED_CUR
  11. enum: RUSAGE_SELF
  12. enum: RUSAGE_CHILDREN
  13. enum: RLIMIT_CORE
  14. enum: RLIMIT_CPU
  15. enum: RLIMIT_DATA
  16. enum: RLIMIT_FSIZE
  17. enum: RLIMIT_NOFILE
  18. enum: RLIMIT_STACK
  19. enum: RLIMIT_AS
  20. ctypedef unsigned long rlim_t
  21. cdef struct rlimit:
  22. rlim_t rlim_cur
  23. rlim_t rlim_max
  24. cdef struct rusage:
  25. timeval ru_utime
  26. timeval ru_stime
  27. long ru_maxrss
  28. long ru_ixrss
  29. long ru_idrss
  30. long ru_isrss
  31. long ru_minflt
  32. long ru_majflt
  33. long ru_nswap
  34. long ru_inblock
  35. long ru_oublock
  36. long ru_msgsnd
  37. long ru_msgrcv
  38. long ru_nsignals
  39. long ru_nvcsw
  40. long ru_nivcsw
  41. int getpriority(int, id_t)
  42. int getrlimit(int, rlimit *)
  43. int getrusage(int, rusage *)
  44. int setpriority(int, id_t, int)
  45. int setrlimit(int, const rlimit *)