Chapter Contents

Previous

Next
setrlimit

setrlimit



Define UNIX System Services Resource Limits

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
USAGE NOTES
RELATED FUNCTIONS


SYNOPSIS

#include <sys/resource.h>
int setrlimit(int resource,
              const struct rlimit *info);


DESCRIPTION

The setrlimit function defines resource limits for the calling process. Limits are expressed as a pair of integers, a soft limit and a hard limit. The soft limit controls the amount of the resource the program is actually allowed to consume, while the hard limit specifies an upper bound on the soft limit. The soft limit can be raised up to the hard limit value, but the hard limit can only be raised by a privileged (superuser) caller.

The resource argument defines the resource to which the limit applies. It should be specified as one of the symbolic values defined below.

The info argument is a pointer to a structure of type struct rlimit , which defines the soft and hard limits. The structure contains the following fields:

  1. rlim_cur - the current (i.e., soft) limit

  2. rlim_max - the maximum limit


RETURN VALUE

setrlimit returns 0 if successful, or -1 if unsuccessful.


USAGE NOTES

The setrlimit function can only be used with MVS 5.2.2 or a later release.

Note:   Resource limits defined by setrlimit are propagated to child processes created by fork or exec .  [cautionend]


RELATED FUNCTIONS

getrlimit


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.