1/* Define struct rusage.
2 Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
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.
9
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.
14
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/>. */
18
19#ifndef __rusage_defined
20#define __rusage_defined 1
21
22#include <bits/types.h>
23#include <bits/types/struct_timeval.h>
24
25/* Structure which says how much of each resource has been used. */
26
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. */
31struct rusage
32 {
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). */
38 __extension__ union
39 {
40 long int ru_maxrss;
41 __syscall_slong_t __ru_maxrss_word;
42 };
43 /* Amount of sharing of text segment memory
44 with other processes (kilobyte-seconds). */
45 /* Maximum resident set size (in kilobytes). */
46 __extension__ union
47 {
48 long int ru_ixrss;
49 __syscall_slong_t __ru_ixrss_word;
50 };
51 /* Amount of data segment memory used (kilobyte-seconds). */
52 __extension__ union
53 {
54 long int ru_idrss;
55 __syscall_slong_t __ru_idrss_word;
56 };
57 /* Amount of stack memory used (kilobyte-seconds). */
58 __extension__ union
59 {
60 long int ru_isrss;
61 __syscall_slong_t __ru_isrss_word;
62 };
63 /* Number of soft page faults (i.e. those serviced by reclaiming
64 a page from the list of pages awaiting reallocation. */
65 __extension__ union
66 {
67 long int ru_minflt;
68 __syscall_slong_t __ru_minflt_word;
69 };
70 /* Number of hard page faults (i.e. those that required I/O). */
71 __extension__ union
72 {
73 long int ru_majflt;
74 __syscall_slong_t __ru_majflt_word;
75 };
76 /* Number of times a process was swapped out of physical memory. */
77 __extension__ union
78 {
79 long int ru_nswap;
80 __syscall_slong_t __ru_nswap_word;
81 };
82 /* Number of input operations via the file system. Note: This
83 and `ru_oublock' do not include operations with the cache. */
84 __extension__ union
85 {
86 long int ru_inblock;
87 __syscall_slong_t __ru_inblock_word;
88 };
89 /* Number of output operations via the file system. */
90 __extension__ union
91 {
92 long int ru_oublock;
93 __syscall_slong_t __ru_oublock_word;
94 };
95 /* Number of IPC messages sent. */
96 __extension__ union
97 {
98 long int ru_msgsnd;
99 __syscall_slong_t __ru_msgsnd_word;
100 };
101 /* Number of IPC messages received. */
102 __extension__ union
103 {
104 long int ru_msgrcv;
105 __syscall_slong_t __ru_msgrcv_word;
106 };
107 /* Number of signals delivered. */
108 __extension__ union
109 {
110 long int ru_nsignals;
111 __syscall_slong_t __ru_nsignals_word;
112 };
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). */
116 __extension__ union
117 {
118 long int ru_nvcsw;
119 __syscall_slong_t __ru_nvcsw_word;
120 };
121 /* Number of involuntary context switches, i.e. a higher priority process
122 became runnable or the current process used up its time slice. */
123 __extension__ union
124 {
125 long int ru_nivcsw;
126 __syscall_slong_t __ru_nivcsw_word;
127 };
128 };
129
130#endif
131