Back to index

glibc  2.9
vtimes.h
Go to the documentation of this file.
00001 /* Copyright (C) 1991, 1992, 1996, 1999 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _SYS_VTIMES_H
00020 #define _SYS_VTIMES_H       1
00021 
00022 #include <features.h>
00023 
00024 __BEGIN_DECLS
00025 
00026 /* This interface is obsolete; use `getrusage' instead.  */
00027 
00028 /* Granularity of the `vm_utime' and `vm_stime' fields of a `struct vtimes'.
00029    (This is the frequency of the machine's power supply, in Hz.)  */
00030 #define       VTIMES_UNITS_PER_SECOND     60
00031 
00032 struct vtimes
00033 {
00034   /* User time used in units of 1/VTIMES_UNITS_PER_SECOND seconds.  */
00035   int vm_utime;
00036   /* System time used in units of 1/VTIMES_UNITS_PER_SECOND seconds.  */
00037   int vm_stime;
00038 
00039   /* Amount of data and stack memory used (kilobyte-seconds).  */
00040   unsigned int vm_idsrss;
00041   /* Amount of text memory used (kilobyte-seconds).  */
00042   unsigned int vm_ixrss;
00043   /* Maximum resident set size (text, data, and stack) (kilobytes).  */
00044   int vm_maxrss;
00045 
00046   /* Number of hard page faults (i.e. those that required I/O).  */
00047   int vm_majflt;
00048   /* Number of soft page faults (i.e. those serviced by reclaiming
00049      a page from the list of pages awaiting reallocation.  */
00050   int vm_minflt;
00051 
00052   /* Number of times a process was swapped out of physical memory.  */
00053   int vm_nswap;
00054 
00055   /* Number of input operations via the file system.  Note: This
00056      and `ru_oublock' do not include operations with the cache.  */
00057   int vm_inblk;
00058   /* Number of output operations via the file system.  */
00059   int vm_oublk;
00060 };
00061 
00062 /* If CURRENT is not NULL, write statistics for the current process into
00063    *CURRENT.  If CHILD is not NULL, write statistics for all terminated child
00064    processes into *CHILD.  Returns 0 for success, -1 for failure.  */
00065 extern int vtimes (struct vtimes * __current, struct vtimes * __child) __THROW;
00066 
00067 __END_DECLS
00068 
00069 #endif /* sys/vtimes.h  */