tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / compiler / posixc / getrlimit.c
bloba6ce939634f7fd375c0a0379f7f79afc86128395
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2008 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()
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;