- Made pciuhci.device and pciehci.device compile again: completed
[AROS.git] / compiler / clib / getrlimit.c
bloba174a02667a6a139c382101343c146ea872db12c
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX function getrlimit().
6 */
8 #include <errno.h>
9 #include <sys/resource.h>
11 #include "__fdesc.h"
13 /*****************************************************************************
15 NAME */
17 int getrlimit (
19 /* SYNOPSIS */
20 int resource,
21 struct rlimit *rlp)
23 /* FUNCTION
24 Get the limits of certain system resources
26 INPUTS
27 resource - the resource type to get
28 rlp - returned resource information
30 RESULT
31 On success, returns 0. -1 and errno on error.
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
40 setrlimit(), getdtablesize()
42 INTERNALS
44 ******************************************************************************/
46 int retval = 0;
48 switch (resource) {
49 case RLIMIT_NOFILE: /* needed for getdtablesize() */
50 rlp->rlim_cur = rlp->rlim_max = __getfdslots();
51 break;
52 default:
53 retval = -1;
54 errno = EINVAL;
55 break;
58 return retval;