From ae1144b1562e7675e9e97529bba7eb168d2f0500 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 21 Jan 2022 04:20:30 +0100 Subject: add prlimit syscall wrapper --- include/sys/resource.h | 7 +++++++ libc/sysdeps/linux/common/Makefile.in | 1 + 2 files changed, 8 insertions(+) diff --git a/include/sys/resource.h b/include/sys/resource.h index 17167ed99..00c63ff0f 100644 --- a/include/sys/resource.h +++ b/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 */ diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 9562de52c..848bc1e4a 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/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 \ -- cgit v1.2.3