document new error cases

state standard conformancy - besides RLIMIT_AS (which is not supported
currently), getrlimit()/setrlimit() conform to SUSv2
use more standard description cookie for error return in RETURN VALUES
mention also ulimit of sh(1), besides limit of csh(1)
This commit is contained in:
jdolecek 2001-11-23 19:50:13 +00:00
parent 889b84bdfc
commit 1c36ca124c
1 changed files with 46 additions and 10 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: getrlimit.2,v 1.17 2001/09/16 01:39:01 wiz Exp $
.\" $NetBSD: getrlimit.2,v 1.18 2001/11/23 19:50:13 jdolecek Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -33,7 +33,7 @@
.\"
.\" @(#)getrlimit.2 8.1 (Berkeley) 6/4/93
.\"
.Dd June 4, 1993
.Dd November 23, 2001
.Dt GETRLIMIT 2
.Os
.Sh NAME
@ -126,10 +126,15 @@ value for a limit is defined as
.Pp
Because this information is stored in the per-process information,
this system call must be executed directly by the shell if it
is to affect all future processes created by the shell;
.Ic limit
is thus a built-in command to
.Xr csh 1 .
is to affect all future processes created by the shell.
Thus, shells provide built-in commands to change the limits
.No ( Ic limit
for
.Xr csh 1 ,
or
.Ic ulimit
for
.Xr sh 1 No ).
.Pp
The system refuses to extend the data or stack space when the limits
would be exceeded in the normal way: a
@ -153,11 +158,12 @@ is sent to the
offending process.
.Sh RETURN VALUES
A 0 return value indicates that the call succeeded, changing
or returning the resource limit. A return value of -1 indicates
that an error occurred, and an error code is stored in the global
location
.Va errno .
or returning the resource limit. Otherwise, a -1 is returned
and the global variable
.Va errno
is set to indicate the error.
.Sh ERRORS
The
.Fn getrlimit
and
.Fn setrlimit
@ -167,12 +173,33 @@ will fail if:
The address specified for
.Fa rlp
is invalid.
.It Bq Er EINVAL
Specified
.Fa resource
was invalid.
.It Bq Er EINVAL
In the
.Fn setrlimit
call, the specified
.Fa rlim_cur
exceeds the specified
.Fa rlim_max .
.It Bq Er EPERM
The limit specified to
.Fn setrlimit
would have
raised the maximum limit value, and the caller is not the super-user.
.El
.Pp
The
.Fn setrlimit
function may fail if:
.Bl -tag -width Er
.It Bq Er EINVAL
The limit specified to
.Fn setrlimit
cannot be lowered, because current usage is already higher than the limit.
.El
.Sh SEE ALSO
.Xr csh 1 ,
.Xr sh 1 ,
@ -180,6 +207,15 @@ raised the maximum limit value, and the caller is not the super-user.
.Xr sigaction 2 ,
.Xr sigaltstack 2 ,
.Xr sysctl 3
.Sh STANDARDS
With exception of
.Li RLIMIT_AS
(which is not currently supported), the
.Fn getrlimit
and
.Fn setrlimit
functions conform to
.St -susv2 .
.Sh HISTORY
The
.Fn getrlimit