1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt, March 28, 1992
.\" and Copyright (c) 2002 Michael Kerrisk
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" 2004-11-16 -- mtk: the getrlimit.2 page, which formerly included
.\" coverage of getrusage(2), has been split, so that the latter is
.\" now covered in its own getrusage.2. For older details of change
.\" history, etc., see getrlimit.2
.\"
.\" Modified 2004-11-16, mtk, Noted that the non-conformance
.\" when SIGCHLD is being ignored is fixed in 2.6.9.
.\" 2008-02-22, Sripathi Kodi <sripathik@in.ibm.com>: Document RUSAGE_THREAD
.\" 2008-05-25, mtk, clarify RUSAGE_CHILDREN + other clean-ups.
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\" all rights reserved.
.\" Translated 1997-02-22, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated and Modified 2001-06-02, Yuichi SATO <ysato444@yahoo.co.jp>
.\" Updated and Modified 2001-08-18, Yuichi SATO
.\" Updated and Modified 2002-08-25, Yuichi SATO
.\" Updated and Modified 2004-01-17, Yuichi SATO
.\" Updated and Modified 2004-12-30, Yuichi SATO
.\" Updated and Modified 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2008-11-10, Akihiro MOTOKI, LDP v3.11
.\"
.TH GETRUSAGE 2 2008-10-06 "Linux" "Linux Programmer's Manual"
.SH ̾
getrusage \- λ̤
.SH
.B #include <sys/time.h>
.br
.B #include <sys/resource.h>
.sp
.BI "int getrusage(int " who ", struct rusage *" usage );
.SH
.PP
.BR getrusage ()
.I who
λ (resource) λ̤֤
.I who
ˤϰʲΤ줫ĤǤ롣
.TP
.B RUSAGE_SELF
ƤӽФץλ̡
ΥץåɤѤƤιפ֤
ԤϸƤӽФץΥ̤ᤷ
ԤϸƤӽФץλҶΤ
λԤ֤ˤץλ̤᤹롣
.TP
.B RUSAGE_CHILDREN
ƤӽФץλҥץΤ
λԤ֤ˤץѤƤ̤פ֤
ˤϡ¹ץ䤽λ¹ΥץΤ
ԤΤΤѤƤޤޤ롣
.TP
.BR RUSAGE_THREAD " (Linux 2.6.26 ʹ)"
ƤӽФåɤ˴ؤ̤פ֤
.PP
̤
.I usage
ؤ¤Τ˳Ǽ֤롣
¤ΤϰʲηǤ롣
.PP
.in +4n
.nf
struct rusage {
struct timeval ru_utime; /* Ѥ줿桼 */
struct timeval ru_stime; /* Ѥ줿ƥ */
long ru_maxrss; /* RAM ¸ߤ벾ۥڡΥ
(resident set size) κ */
long ru_ixrss; /* ͭιץ */
long ru_idrss; /* ͭǡιץ */
long ru_isrss; /* ͭåιץ */
long ru_minflt; /* Ѥ줿ڡ */
long ru_majflt; /* ڡե */
long ru_nswap; /* å */
long ru_inblock; /* ֥å */
long ru_oublock; /* ֥å */
long ru_msgsnd; /* 줿å */
long ru_msgrcv; /* 줿å */
long ru_nsignals; /* 줿ʥ */
long ru_nvcsw; /* տޤƥڤؤ */
long ru_nivcsw; /* տޤʤƥڤؤ */
};
.fi
.in
.SH ֤
0 ֤롣顼ξ \-1 ֤졢
.I errno
Ŭڤͤꤵ롣
.SH 顼
.TP
.B EFAULT
.I usage
ǽʥɥ쥹֤γؤƤ롣
.TP
.B EINVAL
.I who
̵Ǥ롣
.SH
SVr4, 4.3BSD.
POSIX.1-2001
.BR getrusage ()
ꤷƤ뤬ꤷƤեɤ
.I ru_utime
.I ru_stime
Ǥ롣
.B RUSAGE_THREAD
Linux ͭǤ롣
.SH
.BR execve (2)
ǥ̤λɸݻ롣
Ǥ
.I <sys/time.h>
롼ɤɬפϤʤ
롼ɤƤаܿ
(º
.I struct timeval
.I <sys/time.h>
Ƥ롣)
.PP
2.6.9 ΥС Linux ͥǤϡ
.B SIGCHLD
ν
.B SIG_IGN
ꤵƤȡ
ҥץΥ̤
.B RUSAGE_CHILDREN
֤ͤ˼ưŪ˴ޤ롣
POSIX.1-2001 ǤϡΤ˶ػߤƤ롣
νƤʤäϡLinux 2.6.9 ʹߤDz줿
.\" XSH getrusage() Ȥ뤳ȡ
.\" ƱͤεҤ SUSv2 ˤ⤢롣
.LP
ΥڡκǽǼ¤Τ 4.3BSD Reno ΤΤѤ
Linux ǤƤΥեɤ̣ĤȤ櫓ǤϤʤ
Linux 2.4 Ǥϡե
.IR ru_utime ,
.IR ru_stime ,
.IR ru_minflt ,
.I ru_majflt
ΤߤƥʥƤ롣
Linux 2.6 ʹߤǤ
.IR ru_nvcsw ,
.I ru_nivcsw
ƥʥƤ롣
.BR proc (5)
ˤ
.I /proc/PID/stat
⻲ȤΤȡ
.SH Ϣ
.BR clock_gettime (2),
.BR getrlimit (2),
.BR times (2),
.BR wait (2),
.BR wait4 (2),
.BR clock (3)
|