From: Karel Zak Date: Wed, 8 Dec 2021 14:17:01 +0000 (+0100) Subject: prlimit: make syscall use more robust X-Git-Tag: v2.38-rc1~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae9cf963f5f48a835f0cfc8e828f7c1414cf0376;p=thirdparty%2Futil-linux.git prlimit: make syscall use more robust This is only cosmetic change to make code robust and compatible with other spaces where we use syscall(). Signed-off-by: Karel Zak --- diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c index 9317ba0442..ca69ccf98e 100644 --- a/sys-utils/prlimit.c +++ b/sys-utils/prlimit.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include @@ -141,15 +143,19 @@ static int ncolumns; static pid_t pid; /* calling process (default) */ static int verbose; -#ifndef HAVE_PRLIMIT +#ifdef HAVE_SYS_SYSCALL_H # include +# if defined(SYS_prlimit64) +# ifndef HAVE_PRLIMIT static int prlimit(pid_t p, int resource, const struct rlimit *new_limit, struct rlimit *old_limit) { return syscall(SYS_prlimit64, p, resource, new_limit, old_limit); } -#endif +# endif /* !HAVE_PRLIMIT */ +# endif /* SYS_prlimit64 */ +#endif /* HAVE_SYS_SYSCALL_H */ static void __attribute__((__noreturn__)) usage(void) {