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