DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ulimit(S-osr5)


ulimit -- get and set user limits

Syntax

cc . . . -lc

#include <ulimit.h>

long int ulimit(int cmd, ... );

Description

The ulimit routine examines or changes process' file size limits. The cmd values available are:

UL_GETFSIZE
Return the process's regular file size limit in units of 512-byte blocks. The regular file size limit is inherited by child processes. Files of any size may be read.

UL_SETFSIZE
Set the regular file size limit for output operations of the process to the value of the optional second argument (must be of type long). Any process may decrease its own file size limit, but only a process with an effective user ID of super user may increase the limit. The new file size limit is returned by the routine.

Return value

Upon successful completion, the ulimit routine returns the value of the limit requested. If the routine fails, ulimit returns a value of -1 and errno is set to indicate the appropriate error.

Diagnostics

If one of the following conditions occurs, the ulimit routine fails (no values will be changed) and errno is set to the corresponding value:

[EINVAL]
The cmd argument is invalid.

[EPERM]
A process with an effective user ID other than super user attempted to increase its regular file size limit.

See also

write(S-osr5)

Standards conformance

ulimit conforms with: X/Open Portability Guide, Issue 3, 1989 .
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005