The
ulimit() function provides a method to query or alter resource limits of the calling process. The method to be performed is specified by the
cmd argument; possible values are:
UL_GETFSIZE
Return the soft file size limit of the process. The value returned is in units of 512-byte blocks. If the result cannot be represented in an object of type long int, the result is unspecified.
UL_SETFSIZE
Set the hard and soft file size limits of the process to the value of the second argument passed, which is in units of 512-byte blocks, and which is expected to be of type long int. The new file size limit of the process is returned. Any process may decrease the limit, but raising it is only permitted if the caller is the super-user.
If successful, the
ulimit() function will not change the setting of
errno.