1 /* Define struct rusage.
2 Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef __rusage_defined
20 #define __rusage_defined 1
22 #include <bits/types.h>
23 #include <bits/types/struct_timeval.h>
25 /* Structure which says how much of each resource has been used. */
27 /* The purpose of all the unions is to have the kernel-compatible layout
28 while keeping the API type as 'long int', and among machines where
29 __syscall_slong_t is not 'long int', this only does the right thing
30 for little-endian ones, like x32. */
33 /* Total amount of user time used. */
34 struct timeval ru_utime
;
35 /* Total amount of system time used. */
36 struct timeval ru_stime
;
37 /* Maximum resident set size (in kilobytes). */
41 __syscall_slong_t __ru_maxrss_word
;
43 /* Amount of sharing of text segment memory
44 with other processes (kilobyte-seconds). */
45 /* Maximum resident set size (in kilobytes). */
49 __syscall_slong_t __ru_ixrss_word
;
51 /* Amount of data segment memory used (kilobyte-seconds). */
55 __syscall_slong_t __ru_idrss_word
;
57 /* Amount of stack memory used (kilobyte-seconds). */
61 __syscall_slong_t __ru_isrss_word
;
63 /* Number of soft page faults (i.e. those serviced by reclaiming
64 a page from the list of pages awaiting reallocation. */
68 __syscall_slong_t __ru_minflt_word
;
70 /* Number of hard page faults (i.e. those that required I/O). */
74 __syscall_slong_t __ru_majflt_word
;
76 /* Number of times a process was swapped out of physical memory. */
80 __syscall_slong_t __ru_nswap_word
;
82 /* Number of input operations via the file system. Note: This
83 and `ru_oublock' do not include operations with the cache. */
87 __syscall_slong_t __ru_inblock_word
;
89 /* Number of output operations via the file system. */
93 __syscall_slong_t __ru_oublock_word
;
95 /* Number of IPC messages sent. */
99 __syscall_slong_t __ru_msgsnd_word
;
101 /* Number of IPC messages received. */
105 __syscall_slong_t __ru_msgrcv_word
;
107 /* Number of signals delivered. */
110 long int ru_nsignals
;
111 __syscall_slong_t __ru_nsignals_word
;
113 /* Number of voluntary context switches, i.e. because the process
114 gave up the process before it had to (usually to wait for some
115 resource to be available). */
119 __syscall_slong_t __ru_nvcsw_word
;
121 /* Number of involuntary context switches, i.e. a higher priority process
122 became runnable or the current process used up its time slice. */
126 __syscall_slong_t __ru_nivcsw_word
;