Back to index

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

Go to the source code of this file.

Functions

int __getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits)

Function Documentation

int __getrlimit ( enum __rlimit_resource  resource,
struct rlimit rlimits 
)

Definition at line 27 of file getrlimit.c.

{
  struct rlimit lim;

  if (rlimits == NULL || (unsigned int) resource >= RLIMIT_NLIMITS)
    {
      errno = EINVAL;
      return -1;
    }

  HURD_CRITICAL_BEGIN;
  __mutex_lock (&_hurd_rlimit_lock);
  lim = _hurd_rlimits[resource];
  __mutex_unlock (&_hurd_rlimit_lock);
  HURD_CRITICAL_END;

  *rlimits = lim;

  return 0;
}

Here is the call graph for this function: