xref: /PHP-7.2/win32/getrusage.h (revision 03f3b847)
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 
19 #ifndef HAVE_GETRUSAGE_H
20 # define HAVE_GETRUSAGE_H
21 
22 /*
23  * Note
24  *
25  * RUSAGE_CHILDREN is not implemented, and the RUSAGE_THREAD will
26  * therefore instead be used instead to emulate the behavior.
27  */
28 
29 # define RUSAGE_SELF		0
30 # define RUSAGE_CHILDREN	1
31 
32 # define RUSAGE_THREAD		RUSAGE_CHILDREN
33 
34 /*
35  * Implementation support
36  *
37  *  RUSAGE_SELF
38  *		ru_utime
39  *		ru_stime
40  *		ru_majflt
41  *		ru_maxrss
42  *
43  *  RUSAGE_THREAD
44  *		ru_utime
45  *		ru_stime
46  *
47  * Not implemented:
48  *		ru_ixrss		(unused)
49  *		ru_idrss		(unused)
50  *		ru_isrss		(unused)
51  *		ru_minflt
52  *		ru_nswap		(unused)
53  *		ru_inblock
54  *		ru_oublock
55  *		ru_msgsnd		(unused)
56  *		ru_msgrcv		(unused)
57  *		ru_nsignals		(unused)
58  *		ru_nvcsw
59  *		ru_nivcsw
60  */
61 
62 struct rusage
63 {
64 	/* User time used */
65 	struct timeval ru_utime;
66 
67 	/* System time used */
68 	struct timeval ru_stime;
69 
70 	/* Integral max resident set size */
71 	zend_long ru_maxrss;
72 
73 	/* Page faults */
74 	zend_long ru_majflt;
75 #if 0
76 	/* Integral shared text memory size */
77 	zend_long ru_ixrss;
78 
79 	/* Integral unshared data size */
80 	zend_long ru_idrss;
81 
82 	/* Integral unshared stack size */
83 	zend_long ru_isrss;
84 
85 	/* Page reclaims */
86 	zend_long ru_minflt;
87 
88 	/* Swaps */
89 	zend_long ru_nswap;
90 
91 	/* Block input operations */
92 	zend_long ru_inblock;
93 
94 	/* Block output operations */
95 	zend_long ru_oublock;
96 
97 	/* Messages sent */
98 	zend_long ru_msgsnd;
99 
100 	/* Messages received */
101 	zend_long ru_msgrcv;
102 
103 	/* Signals received */
104 	zend_long ru_nsignals;
105 
106 	/* Voluntary context switches */
107 	zend_long ru_nvcsw;
108 
109 	/* Involuntary context switches */
110 	zend_long ru_nivcsw;
111 #endif
112 };
113 
114 PHPAPI int getrusage(int who, struct rusage *usage);
115 
116 #endif
117 
118 /*
119  * Local variables:
120  * tab-width: 4
121  * c-basic-offset: 4
122  * End:
123  * vim600: sw=4 ts=4 fdm=marker
124  * vim<600: sw=4 ts=4
125  */
126