about summary refs log tree commit diff
path: root/src/misc/setrlimit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/setrlimit.c')
-rw-r--r--src/misc/setrlimit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/misc/setrlimit.c b/src/misc/setrlimit.c
new file mode 100644
index 00000000..7fdfc4e5
--- /dev/null
+++ b/src/misc/setrlimit.c
@@ -0,0 +1,11 @@
+#include <sys/resource.h>
+#include "syscall.h"
+#include "libc.h"
+
+int setrlimit(int resource, const struct rlimit *rlim)
+{
+	long k_rlim[2] = { rlim->rlim_cur, rlim->rlim_max };
+	return syscall2(__NR_setrlimit, resource, (long)k_rlim);
+}
+
+LFS64(setrlimit);