repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
etc/services - sync with NetBSD-8
[minix.git]
/
minix
/
lib
/
libc
/
sys
/
setrlimit.c
blob
8e94f31b2feb5485118fcfd8a51f79cdd302d6f0
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
13
switch
(
resource
)
14
{
15
case
RLIMIT_CPU
:
16
case
RLIMIT_FSIZE
:
17
case
RLIMIT_DATA
:
18
case
RLIMIT_STACK
:
19
case
RLIMIT_CORE
:
20
case
RLIMIT_RSS
:
21
case
RLIMIT_MEMLOCK
:
22
case
RLIMIT_NPROC
:
23
case
RLIMIT_NOFILE
:
24
case
RLIMIT_SBSIZE
:
25
case
RLIMIT_AS
:
26
/* case RLIMIT_VMEM: Same as RLIMIT_AS */
27
case
RLIMIT_NTHR
:
28
break
;
29
30
default
:
31
errno
=
EINVAL
;
32
return
-
1
;
33
}
34
35
return
0
;
36
}