Back to index

glibc  2.9
Functions
setrlimit.c File Reference
#include <sys/resource.h>
#include <stddef.h>
#include <errno.h>

Go to the source code of this file.

Functions

int setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits)

Function Documentation

int setrlimit ( enum __rlimit_resource  resource,
const struct rlimit rlimits 
)

Definition at line 30 of file setrlimit.c.

{
  if (rlimits == NULL)
    {
      __set_errno (EINVAL);
      return -1;
    }

  switch (resource)
    {
    case RLIMIT_FSIZE:
      return __ulimit (2, rlimits->rlim_cur);

    case RLIMIT_DATA:
    case RLIMIT_CPU:
    case RLIMIT_STACK:
    case RLIMIT_CORE:
    case RLIMIT_RSS:
      __set_errno (ENOSYS);
      return -1;

    default:
      __set_errno (EINVAL);
      return -1;
    }
}

Here is the call graph for this function: