uulliimmiitt() -- System Call (libc)

Get/set limits for a process
#iinncclluuddee <uulliimmiitt.hh>
lloonngg uulliimmiitt (_c_o_m_m_a_n_d [, _b_l_o_c_k_s^])
iinntt _c_o_m_m_a_n_d, _b_l_o_c_k_s^;

The system call uulliimmiitt() retrieves or sets limits on what a process can do.
_c_o_m_m_a_n_d indicates what you want it to do, as follows:

UULL_GGEETTFFSSIIZZEE
   Return the maximum  size, in blocks, of a file  that the current process
   can create.

UULL_SSEETTFFSSIIZZEE
   Limit  to _b_l_o_c_k_s  the size  of  any regular  file that  any process  can
   create.  A process may decrease this  limit, but only a process owned by
   the superuser rroooott can increase it.

UULL_GGMMEEMMLLIIMM
   Return  the current  process's break  value.  For  details on  the break
   value, see the Lexicon entry for bbrrkk().

UULL_GGDDEESSLLIIMM
   Return the maximum number of files that this process can open.

Each of  the above commands  is defined in  the header file  uulliimmiitt.hh. When
called  to execute  the  command UULL_SSEETTFFSSIIZZEE,  uulliimmiitt()  requires a  second
integer argument; when called  to execute any other command, uulliimmiitt() takes
only one argument.

If all goes well, uulliimmiitt() returns a non-negative value.  uulliimmiitt() fails if
any of the following occur:

-> A process  owned by someone  other than the superuser  rroooott attempted to
   increase its  file-size limit.   uulliimmiitt() returns  -1 and sets  eerrrrnnoo to
   EEPPEERRMM.

-> The  first argument  to uulliimmiitt()  was  something other  than one  of the
   above-named values.  uulliimmiitt() returns -1 and sets eerrrrnnoo to EEIINNVVAALL.

_S_e_e _A_l_s_o
bbrrkk(), lliibbcc, uulliimmiitt.hh

_N_o_t_e_s

uulliimmiitt() does not fail _p_e_r _s_e  if you invoke it with option UULL_SSEETTFFSSIIZZEE and
do not supply a second argument.   However, doing so will (or should) crash
the process.  _C_a_v_e_a_t _u_t_i_l_i_t_o_r.
