getrusage.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Kalle Sommer Nielsen <kalle@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef HAVE_GETRUSAGE_H
  19. # define HAVE_GETRUSAGE_H
  20. /*
  21. * Note
  22. *
  23. * RUSAGE_CHILDREN is not implemented, and the RUSAGE_THREAD will
  24. * therefore instead be used instead to emulate the behavior.
  25. */
  26. # define RUSAGE_SELF 0
  27. # define RUSAGE_CHILDREN 1
  28. # define RUSAGE_THREAD RUSAGE_CHILDREN
  29. /*
  30. * Implementation support
  31. *
  32. * RUSAGE_SELF
  33. * ru_utime
  34. * ru_stime
  35. * ru_majflt
  36. * ru_maxrss
  37. *
  38. * RUSAGE_THREAD
  39. * ru_utime
  40. * ru_stime
  41. *
  42. * Not implemented:
  43. * ru_ixrss (unused)
  44. * ru_idrss (unused)
  45. * ru_isrss (unused)
  46. * ru_minflt
  47. * ru_nswap (unused)
  48. * ru_inblock
  49. * ru_oublock
  50. * ru_msgsnd (unused)
  51. * ru_msgrcv (unused)
  52. * ru_nsignals (unused)
  53. * ru_nvcsw
  54. * ru_nivcsw
  55. */
  56. struct rusage
  57. {
  58. /* User time used */
  59. struct timeval ru_utime;
  60. /* System time used */
  61. struct timeval ru_stime;
  62. /* Integral max resident set size */
  63. zend_long ru_maxrss;
  64. /* Page faults */
  65. zend_long ru_majflt;
  66. #if 0
  67. /* Integral shared text memory size */
  68. zend_long ru_ixrss;
  69. /* Integral unshared data size */
  70. zend_long ru_idrss;
  71. /* Integral unshared stack size */
  72. zend_long ru_isrss;
  73. /* Page reclaims */
  74. zend_long ru_minflt;
  75. /* Swaps */
  76. zend_long ru_nswap;
  77. /* Block input operations */
  78. zend_long ru_inblock;
  79. /* Block output operations */
  80. zend_long ru_oublock;
  81. /* Messages sent */
  82. zend_long ru_msgsnd;
  83. /* Messages received */
  84. zend_long ru_msgrcv;
  85. /* Signals received */
  86. zend_long ru_nsignals;
  87. /* Voluntary context switches */
  88. zend_long ru_nvcsw;
  89. /* Involuntary context switches */
  90. zend_long ru_nivcsw;
  91. #endif
  92. };
  93. PHPAPI int getrusage(int who, struct rusage *usage);
  94. #endif
  95. /*
  96. * Local variables:
  97. * tab-width: 4
  98. * c-basic-offset: 4
  99. * End:
  100. * vim600: sw=4 ts=4 fdm=marker
  101. * vim<600: sw=4 ts=4
  102. */