xref: /minix/minix/lib/libc/sys/setrlimit.c (revision 83133719)
1 #include <sys/cdefs.h>
2 #include "namespace.h"
3 
4 #include <errno.h>
5 #include <limits.h>
6 #include <sys/resource.h>
7 #include <unistd.h>
8 
9 /* Simple stub for now. */
10 int setrlimit(int resource, const struct rlimit *rlp)
11 {
12 	rlim_t limit;
13 
14 	switch (resource)
15 	{
16 		case RLIMIT_CPU:
17 		case RLIMIT_FSIZE:
18 		case RLIMIT_DATA:
19 		case RLIMIT_STACK:
20 		case RLIMIT_CORE:
21 		case RLIMIT_RSS:
22 		case RLIMIT_MEMLOCK:
23 		case RLIMIT_NPROC:
24 		case RLIMIT_NOFILE:
25 		case RLIMIT_SBSIZE:
26 		case RLIMIT_AS:
27 		/* case RLIMIT_VMEM: Same as RLIMIT_AS */
28 		case RLIMIT_NTHR:
29 			break;
30 
31 		default:
32 			errno = EINVAL;
33 			return -1;
34 	}
35 
36 	return 0;
37 }
38 
39