225 lines
6.6 KiB
HTML
225 lines
6.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title><sys/resource.h></title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../../jscript/dotcode.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="<sys/resource.h>"></a> <a name="tag_13_57"></a><!-- <sys/resource.h> -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_13_57_01"></a>NAME</h4>
|
|
|
|
<blockquote>sys/resource.h - definitions for XSI resource operations</blockquote>
|
|
|
|
<h4><a name="tag_13_57_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> #include <sys/resource.h> <img src="../../images/opt-end.gif" alt="[Option End]" border=
|
|
"0"></tt></div>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_57_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i><sys/resource.h></i> header shall define the following symbolic constants as possible values of the <i>which</i>
|
|
argument of <a href="../../functions/getpriority.html"><i>getpriority</i>()</a> and <a href=
|
|
"../../functions/setpriority.html"><i>setpriority</i>()</a>:</p>
|
|
|
|
<dl compact>
|
|
<dt>PRIO_PROCESS</dt>
|
|
|
|
<dd>Identifies the <i>who</i> argument as a process ID.</dd>
|
|
|
|
<dt>PRIO_PGRP</dt>
|
|
|
|
<dd>Identifies the <i>who</i> argument as a process group ID.</dd>
|
|
|
|
<dt>PRIO_USER</dt>
|
|
|
|
<dd>Identifies the <i>who</i> argument as a user ID.</dd>
|
|
</dl>
|
|
|
|
<p>The following type shall be defined through <b>typedef</b>:</p>
|
|
|
|
<dl compact>
|
|
<dt><b>rlim_t</b></dt>
|
|
|
|
<dd>Unsigned integer type used for limit values.</dd>
|
|
</dl>
|
|
|
|
<p>The following symbolic constants shall be defined:</p>
|
|
|
|
<dl compact>
|
|
<dt>RLIM_INFINITY</dt>
|
|
|
|
<dd>A value of <b>rlim_t</b> indicating no limit.</dd>
|
|
|
|
<dt>RLIM_SAVED_MAX</dt>
|
|
|
|
<dd>A value of type <b>rlim_t</b> indicating an unrepresentable saved hard limit.</dd>
|
|
|
|
<dt>RLIM_SAVED_CUR</dt>
|
|
|
|
<dd>A value of type <b>rlim_t</b> indicating an unrepresentable saved soft limit.</dd>
|
|
</dl>
|
|
|
|
<p>On implementations where all resource limits are representable in an object of type <b>rlim_t</b>, RLIM_SAVED_MAX and
|
|
RLIM_SAVED_CUR need not be distinct from RLIM_INFINITY.</p>
|
|
|
|
<p>The following symbolic constants shall be defined as possible values of the <i>who</i> parameter of <a href=
|
|
"../../functions/getrusage.html"><i>getrusage</i>()</a>:</p>
|
|
|
|
<dl compact>
|
|
<dt>RUSAGE_SELF</dt>
|
|
|
|
<dd>Returns information about the current process.</dd>
|
|
|
|
<dt>RUSAGE_CHILDREN</dt>
|
|
|
|
<dd>Returns information about children of the current process.</dd>
|
|
</dl>
|
|
|
|
<p>The <i><sys/resource.h></i> header shall define the <b>rlimit</b> structure that includes at least the following
|
|
members:</p>
|
|
|
|
<pre>
|
|
<tt>rlim_t rlim_cur </tt> The current (soft) limit. <tt>
|
|
rlim_t rlim_max </tt> The hard limit. <tt>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The <i><sys/resource.h></i> header shall define the <b>rusage</b> structure that includes at least the following
|
|
members:</p>
|
|
|
|
<pre>
|
|
<tt>struct timeval ru_utime </tt> User time used. <tt>
|
|
struct timeval ru_stime </tt> System time used. <tt>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The <b>timeval</b> structure shall be defined as described in <a href=
|
|
"../sys/time.h.html#tag_13_64"><i><sys/time.h></i></a> .</p>
|
|
|
|
<p>The following symbolic constants shall be defined as possible values for the <i>resource</i> argument of <a href=
|
|
"../../functions/getrlimit.html"><i>getrlimit</i>()</a> and <a href="../../functions/setrlimit.html"><i>setrlimit</i>()</a>:</p>
|
|
|
|
<dl compact>
|
|
<dt>RLIMIT_CORE</dt>
|
|
|
|
<dd>Limit on size of <b>core</b> file.</dd>
|
|
|
|
<dt>RLIMIT_CPU</dt>
|
|
|
|
<dd>Limit on CPU time per process.</dd>
|
|
|
|
<dt>RLIMIT_DATA</dt>
|
|
|
|
<dd>Limit on data segment size.</dd>
|
|
|
|
<dt>RLIMIT_FSIZE</dt>
|
|
|
|
<dd>Limit on file size.</dd>
|
|
|
|
<dt>RLIMIT_NOFILE</dt>
|
|
|
|
<dd>Limit on number of open files.</dd>
|
|
|
|
<dt>RLIMIT_STACK</dt>
|
|
|
|
<dd>Limit on stack size.</dd>
|
|
|
|
<dt>RLIMIT_AS</dt>
|
|
|
|
<dd>Limit on address space size.</dd>
|
|
</dl>
|
|
|
|
<p>The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.</p>
|
|
|
|
<pre>
|
|
<tt>int getpriority(int, id_t);
|
|
int getrlimit(int, struct rlimit *);
|
|
int getrusage(int, struct rusage *);
|
|
int setpriority(int, id_t, int);
|
|
int setrlimit(int, const struct rlimit *);
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>The <b>id_t</b> type shall be defined through <b>typedef</b> as described in <a href=
|
|
"../sys/types.h.html#tag_13_67"><i><sys/types.h></i></a> .</p>
|
|
|
|
<p>Inclusion of the <i><sys/resource.h></i> header may also make visible all symbols from <a href=
|
|
"../../basedefs/sys/time.h.html"><i><sys/time.h></i></a>.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_13_57_04"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_57_05"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_57_06"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_57_07"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="../sys/time.h.html#tag_13_64"><i><sys/time.h></i></a> , <a href=
|
|
"../sys/types.h.html#tag_13_67"><i><sys/types.h></i></a> , the System Interfaces volume of IEEE Std 1003.1-2001, <a
|
|
href="../../functions/getpriority.html"><i>getpriority</i>()</a>, <a href="../../functions/getrusage.html"><i>getrusage</i>()</a>,
|
|
<a href="../../functions/getrlimit.html"><i>getrlimit</i>()</a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_57_08"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 4, Version 2.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_13_57_09"></a>Issue 5</h4>
|
|
|
|
<blockquote>
|
|
<p>Large File System extensions are added.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../../mindex.html">Main Index</a> | <a href="../../basedefs/contents.html">XBD</a> | <a href=
|
|
"../../utilities/contents.html">XCU</a> | <a href="../../functions/contents.html">XSH</a> | <a href=
|
|
"../../xrat/contents.html">XRAT</a> ]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|