📄 getrusage.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>getrusage</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_722"> </a>NAME</h4><blockquote>getrusage - get information about resource utilisation</blockquote><h4><a name = "tag_000_005_723"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="sysresource.h.html">sys/resource.h</a>>int getrusage(int <i>who</i>, struct rusage *<i>r_usage</i>);</code></pre></blockquote><h4><a name = "tag_000_005_724"> </a>DESCRIPTION</h4><blockquote>The<i>getrusage()</i>function provides measures ofthe resources used by the current process or its terminated andwaited-for child processes. If the value of the <i>who</i> argument isRUSAGE_SELF, information is returned about resources usedby the current process.If the value of the <i>who</i> argument is RUSAGE_CHILDREN,information is returned about resources used by the terminated andwaited-for children of the current process.If the child is never waited for (for instance, if the parent hasSA_NOCLDWAIT set or sets SIGCHLD to SIG_IGN), the resourceinformation for the child process is discarded and not includedin the resource information provided by<i>getrusage()</i>.<p>The <i>r_usage</i> argument is a pointer to an object of type <b>structrusage</b> in which the returned information is stored.</blockquote><h4><a name = "tag_000_005_725"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>getrusage()</i>returns 0. Otherwise, -1 is returned, and <i>errno</i> is set to indicatethe error.</blockquote><h4><a name = "tag_000_005_726"> </a>ERRORS</h4><blockquote>The<i>getrusage()</i>function will fail if:<dl compact><dt>[EINVAL]<dd>The value of the <i>who</i> argument is not valid.</dl></blockquote><h4><a name = "tag_000_005_727"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_728"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_729"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_730"> </a>SEE ALSO</h4><blockquote><i><a href="exit.html">exit()</a></i>,<i><a href="sigaction.html">sigaction()</a></i>,<i><a href="time.html">time()</a></i>,<i><a href="times.html">times()</a></i>,<i><a href="wait.html">wait()</a></i>,<i><a href="sysresource.h.html"><sys/resource.h></a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -