summaryrefslogtreecommitdiff
path: root/minix/lib/libc/sys/setrlimit.c
blob: 8e94f31b2feb5485118fcfd8a51f79cdd302d6f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <sys/cdefs.h>
#include "namespace.h"

#include <errno.h>
#include <limits.h>
#include <sys/resource.h>
#include <unistd.h>

/* Simple stub for now. */
int setrlimit(int resource, const struct rlimit *rlp)
{

	switch (resource)
	{
		case RLIMIT_CPU:
		case RLIMIT_FSIZE:
		case RLIMIT_DATA:
		case RLIMIT_STACK:
		case RLIMIT_CORE:
		case RLIMIT_RSS:
		case RLIMIT_MEMLOCK:
		case RLIMIT_NPROC:
		case RLIMIT_NOFILE:
		case RLIMIT_SBSIZE:
		case RLIMIT_AS:
		/* case RLIMIT_VMEM: Same as RLIMIT_AS */
		case RLIMIT_NTHR:
			break;

		default:
			errno = EINVAL;
			return -1;
	}		

	return 0;
}