Stub for setrlimit
Change-Id: I54c7233d71805711bd72e1e751456aad30fd3e35
This commit is contained in:
@@ -22,7 +22,7 @@ SRCS+= accept.c access.c adjtime.c bind.c brk.c sbrk.c m_closefrom.c getsid.c \
|
||||
sync.c syscall.c sysuname.c truncate.c umask.c unlink.c write.c \
|
||||
utimensat.c utimes.c futimes.c lutimes.c futimens.c \
|
||||
_exit.c _ucontext.c environ.c __getcwd.c vfork.c sizeup.c init.c \
|
||||
getrusage.c
|
||||
getrusage.c setrlimit.c
|
||||
|
||||
# Minix specific syscalls / utils.
|
||||
SRCS+= cprofile.c sprofile.c stack_utils.c _mcontext.c
|
||||
|
||||
@@ -20,12 +20,18 @@ int getrlimit(int resource, struct rlimit *rlp)
|
||||
|
||||
switch (resource)
|
||||
{
|
||||
case RLIMIT_CORE:
|
||||
case RLIMIT_CPU:
|
||||
case RLIMIT_DATA:
|
||||
case RLIMIT_FSIZE:
|
||||
case RLIMIT_DATA:
|
||||
case RLIMIT_STACK:
|
||||
case RLIMIT_CORE:
|
||||
case RLIMIT_RSS:
|
||||
case RLIMIT_MEMLOCK:
|
||||
case RLIMIT_NPROC:
|
||||
case RLIMIT_SBSIZE:
|
||||
case RLIMIT_AS:
|
||||
/* case RLIMIT_VMEM: Same as RLIMIT_AS */
|
||||
case RLIMIT_NTHR:
|
||||
/* no limit enforced (however architectural limits
|
||||
* may apply)
|
||||
*/
|
||||
|
||||
38
lib/libc/sys-minix/setrlimit.c
Normal file
38
lib/libc/sys-minix/setrlimit.c
Normal file
@@ -0,0 +1,38 @@
|
||||
#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)
|
||||
{
|
||||
rlim_t limit;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user