xref: /llvm-project/libc/include/llvm-libc-types/struct_rusage.h (revision 88a0a318e80565fef9367728b878641d261acfb6)
1 //===-- Definition of type struct rusage ----------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIBC_TYPES_STRUCT_RUSAGE_H
10 #define LLVM_LIBC_TYPES_STRUCT_RUSAGE_H
11 
12 #include "struct_timeval.h"
13 
14 struct rusage {
15   struct timeval ru_utime;
16   struct timeval ru_stime;
17 #ifdef __linux__
18   // Following fields are linux extensions as expected by the
19   // linux syscalls.
20   long ru_maxrss;   // Maximum resident set size
21   long ru_ixrss;    // Integral shared memory size
22   long ru_idrss;    // Integral unshared data size
23   long ru_isrss;    // Integral unshared stack size
24   long ru_minflt;   // Page reclaims
25   long ru_majflt;   // Page faults
26   long ru_nswap;    // Swaps
27   long ru_inblock;  // Block input operations
28   long ru_oublock;  // Block output operations
29   long ru_msgsnd;   // Messages sent
30   long ru_msgrcv;   // Messages received
31   long ru_nsignals; // Signals received
32   long ru_nvcsw;    // Voluntary context switches
33   long ru_nivcsw;   // Involuntary context switches
34 #endif
35 };
36 
37 #endif // LLVM_LIBC_TYPES_STRUCT_RUSAGE_H
38