*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> ulimit (3)              
Title
Content
Arch
Section
 

ULIMIT(3)

Contents


NAME    [Toc]    [Back]

     ulimit - get and set process limits

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <ulimit.h>

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

DESCRIPTION    [Toc]    [Back]

     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.

     The ulimit() function is an obsolete interface; applications are encouraged
 to use getrlimit(2) and setrlimit(2) instead.

RETURN VALUES    [Toc]    [Back]

     If successful, the ulimit() function returns the value of the requested
     limit.  Otherwise, it returns -1, sets errno to indicate an error, and
     the limit is not changed.  Therefore, to detect an error condition applications
 should set errno to 0, call ulimit(), and check if -1 is returned
     and errno is non-zero.

ERRORS    [Toc]    [Back]

     The ulimit() function will fail if:

     [EINVAL]           The cmd argument is not valid.

     [EPERM]            It was attempted to increase a limit, and the caller
                        is not the super-user.

SEE ALSO    [Toc]    [Back]

      
      
     getrlimit(2), setrlimit(2)

STANDARDS    [Toc]    [Back]

     The ulimit() function conforms to X/Open System Interfaces and Headers
     Issue 5 (``XSH5'').

BSD                           September 13, 1999                           BSD
[ Back ]
 Similar pages
Name OS Title
ulimit Tru64 Set and gets process limits
limits FreeBSD set or display process resource limits
ulimit IRIX get and set user limits
ulimit Linux get and set user limits
ulimit HP-UX get and set user limits
sched_get_priority_max FreeBSD get scheduling parameter limits
sched_get_priority_min FreeBSD get scheduling parameter limits
getrlimit Linux get/set resource limits and usage
sched_rr_get_interval FreeBSD get scheduling parameter limits
quota HP-UX display disk usage and limits
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service