Back to index

glibc  2.9
Defines | Enumerations | Functions
vlimit.h File Reference
#include <features.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define INFINITY   0x7fffffff

Enumerations

enum  __vlimit_resource {
  LIM_NORAISE, LIM_CPU, LIM_FSIZE, LIM_DATA,
  LIM_STACK, LIM_CORE, LIM_MAXRSS
}

Functions

int vlimit (enum __vlimit_resource __resource, int __value) __THROW

Define Documentation

#define INFINITY   0x7fffffff

Definition at line 58 of file vlimit.h.


Enumeration Type Documentation

Enumerator:
LIM_NORAISE 
LIM_CPU 
LIM_FSIZE 
LIM_DATA 
LIM_STACK 
LIM_CORE 
LIM_MAXRSS 

Definition at line 29 of file vlimit.h.

{
  /* Setting this non-zero makes it impossible to raise limits.
     Only the super-use can set it to zero.

     This is not implemented in recent versions of BSD, nor by
     the GNU C library.  */
  LIM_NORAISE,

  /* CPU time available for each process (seconds).  */
  LIM_CPU,

  /* Largest file which can be created (bytes).  */
  LIM_FSIZE,

  /* Maximum size of the data segment (bytes).  */
  LIM_DATA,

  /* Maximum size of the stack segment (bytes).  */
  LIM_STACK,

  /* Largest core file that will be created (bytes).  */
  LIM_CORE,

  /* Resident set size (bytes).  */
  LIM_MAXRSS
};

Function Documentation

int vlimit ( enum __vlimit_resource  __resource,
int  __value 
)

Definition at line 30 of file vlimit.c.

{
  if (resource >= LIM_CPU && resource <= LIM_MAXRSS)
    {
      /* The rlimit codes happen to each be one less
        than the corresponding vlimit codes.  */
      enum __rlimit_resource rlimit_res =
       (enum __rlimit_resource) ((int) resource - 1);
      struct rlimit lims;

      if (__getrlimit (rlimit_res, &lims) < 0)
       return -1;

      lims.rlim_cur = value;
      return __setrlimit (rlimit_res, &lims);
    }

  __set_errno (EINVAL);
  return -1;
}

Here is the call graph for this function: