]> xenbits.xensource.com Git - unikraft/libs/musl.git/commitdiff
Fix the definition of the prlimit64 syscall
authorMarco Schlumpp <marco@unikraft.io>
Tue, 18 Apr 2023 12:55:03 +0000 (14:55 +0200)
committerUnikraft <monkey@unikraft.io>
Thu, 4 May 2023 14:30:06 +0000 (14:30 +0000)
The `sys/resource.h` header adds #define-based redirection from
`prlimit64` to `prlimit` when `_GNU_SOURCE` is set. This causes our
`provided_syscalls` to incorrectly define `uk_syscall_r_prlimit` instead
of `uk_syscall_r_prlimit64`. By reordering, the headers we can side-step
this problem.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #41

patches/0021-prlimit64_conflict.patch [new file with mode: 0644]

diff --git a/patches/0021-prlimit64_conflict.patch b/patches/0021-prlimit64_conflict.patch
new file mode 100644 (file)
index 0000000..a554f85
--- /dev/null
@@ -0,0 +1,11 @@
+diff --git a/src/linux/prlimit.c b/src/linux/prlimit.c
+--- a/src/linux/prlimit.c      
++++ b/src/linux/prlimit.c      (date 1680775764222)
+@@ -1,6 +1,6 @@
+ #define _GNU_SOURCE
+-#include <sys/resource.h>
+ #include "syscall.h"
++#include <sys/resource.h>
+ #define FIX(x) do{ if ((x)>=SYSCALL_RLIM_INFINITY) (x)=RLIM_INFINITY; }while(0)