Blame resource/bits/types/struct_rusage.h

Packit 6c4009
/* Define struct rusage.
Packit 6c4009
   Copyright (C) 1994-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef __rusage_defined
Packit 6c4009
#define __rusage_defined 1
Packit 6c4009
Packit 6c4009
#include <bits/types.h>
Packit 6c4009
#include <bits/types/struct_timeval.h>
Packit 6c4009
Packit 6c4009
/* Structure which says how much of each resource has been used.  */
Packit 6c4009
Packit 6c4009
/* The purpose of all the unions is to have the kernel-compatible layout
Packit 6c4009
   while keeping the API type as 'long int', and among machines where
Packit 6c4009
   __syscall_slong_t is not 'long int', this only does the right thing
Packit 6c4009
   for little-endian ones, like x32.  */
Packit 6c4009
struct rusage
Packit 6c4009
  {
Packit 6c4009
    /* Total amount of user time used.  */
Packit 6c4009
    struct timeval ru_utime;
Packit 6c4009
    /* Total amount of system time used.  */
Packit 6c4009
    struct timeval ru_stime;
Packit 6c4009
    /* Maximum resident set size (in kilobytes).  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_maxrss;
Packit 6c4009
	__syscall_slong_t __ru_maxrss_word;
Packit 6c4009
      };
Packit 6c4009
    /* Amount of sharing of text segment memory
Packit 6c4009
       with other processes (kilobyte-seconds).  */
Packit 6c4009
    /* Maximum resident set size (in kilobytes).  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_ixrss;
Packit 6c4009
	__syscall_slong_t __ru_ixrss_word;
Packit 6c4009
      };
Packit 6c4009
    /* Amount of data segment memory used (kilobyte-seconds).  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_idrss;
Packit 6c4009
	__syscall_slong_t __ru_idrss_word;
Packit 6c4009
      };
Packit 6c4009
    /* Amount of stack memory used (kilobyte-seconds).  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_isrss;
Packit 6c4009
	 __syscall_slong_t __ru_isrss_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of soft page faults (i.e. those serviced by reclaiming
Packit 6c4009
       a page from the list of pages awaiting reallocation.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_minflt;
Packit 6c4009
	__syscall_slong_t __ru_minflt_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of hard page faults (i.e. those that required I/O).  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_majflt;
Packit 6c4009
	__syscall_slong_t __ru_majflt_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of times a process was swapped out of physical memory.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_nswap;
Packit 6c4009
	__syscall_slong_t __ru_nswap_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of input operations via the file system.  Note: This
Packit 6c4009
       and `ru_oublock' do not include operations with the cache.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_inblock;
Packit 6c4009
	__syscall_slong_t __ru_inblock_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of output operations via the file system.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_oublock;
Packit 6c4009
	__syscall_slong_t __ru_oublock_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of IPC messages sent.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_msgsnd;
Packit 6c4009
	__syscall_slong_t __ru_msgsnd_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of IPC messages received.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_msgrcv;
Packit 6c4009
	__syscall_slong_t __ru_msgrcv_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of signals delivered.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_nsignals;
Packit 6c4009
	__syscall_slong_t __ru_nsignals_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of voluntary context switches, i.e. because the process
Packit 6c4009
       gave up the process before it had to (usually to wait for some
Packit 6c4009
       resource to be available).  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_nvcsw;
Packit 6c4009
	__syscall_slong_t __ru_nvcsw_word;
Packit 6c4009
      };
Packit 6c4009
    /* Number of involuntary context switches, i.e. a higher priority process
Packit 6c4009
       became runnable or the current process used up its time slice.  */
Packit 6c4009
    __extension__ union
Packit 6c4009
      {
Packit 6c4009
	long int ru_nivcsw;
Packit 6c4009
	__syscall_slong_t __ru_nivcsw_word;
Packit 6c4009
      };
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
#endif