Browse Source

add prlimit syscall wrapper

Waldemar Brodkorb 2 years ago
parent
commit
ae1144b156
2 changed files with 8 additions and 0 deletions
  1. 7 0
      include/sys/resource.h
  2. 1 0
      libc/sysdeps/linux/common/Makefile.in

+ 7 - 0
include/sys/resource.h

@@ -101,6 +101,13 @@ extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
      __THROW;
 libc_hidden_proto(setpriority)
 
+#ifdef __USE_GNU
+/* Modify and return resource limits of a process atomically.  */
+extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
+		      const struct rlimit *__new_limit,
+		      struct rlimit *__old_limit) __THROW;
+#endif
+
 __END_DECLS
 
 #endif	/* sys/resource.h  */

+ 1 - 0
libc/sysdeps/linux/common/Makefile.in

@@ -38,6 +38,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
 	pipe2.c \
 	ppoll.c \
 	prctl.c \
+	prlimit.c \
 	readahead.c \
 	reboot.c \
 	remap_file_pages.c \