Back to index

glibc  2.9
vlimit.c File Reference
#include <sys/vlimit.h>
#include <sys/resource.h>
#include <errno.h>

Go to the source code of this file.


int vlimit (enum __vlimit_resource resource, int value)

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: