ulimit()

control process limits 

Function


SYNOPSIS

#include <ulimit.h>

long ulimit(int cmd, ...);


DESCRIPTION

The ulimit() function provides for control over process limits. The following cmd values are available.

UL_GETFSIZE  

Gets the regular file size limit of the process. The limit is in units of 512-byte blocks and is inherited by child processes. Files of any size can be read.

UL_SETFSIZE  

Sets the regular file size limit of the process to the value of newlimit, taken as a long. Any process can decrease this limit; however, only a process with an effective user ID of super user can increase the limit.

The ulimit() function is effective in limiting the growth of regular files.


PARAMETERS

cmd 

Is one of the UL_ constants listed in the DESCRIPTION section.

... 

Represents a long integer used with UL_SETFSIZE to specify newlimit. The limit is in units of 512-byte blocks. This parameter is not used for any other cmd value.


RETURN VALUES

If successful, ulimit() returns a non-negative value. On failure, it returns -1 and sets errno to one of the following values:

EINVAL 

cmd is not valid.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

On the NuTCRACKER Platform, ulimit(UL_GETFSIZE) always returns LONG_MAX, and attempts to reduce the limit with ulimit(UL_SETFSIZE) are silently ignored.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
write()


PTC MKS Toolkit 10.3 Documentation Build 39.