summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPavel Kozlov <pavel.kozlov@synopsys.com>2023-11-07 15:03:12 +0400
committerWaldemar Brodkorb <wbx@openadk.org>2023-11-10 16:13:19 +0100
commit4bf3912213ed8d0fa937fb4784a3e8e0c8fd8c3c (patch)
treeda9fff79f12236fdb6b21fdd92a0d07945713071 /include
parentc303df56d32faa47ef163726357ed3ee5d075b88 (diff)
prlimit: add name redirection and fix incorrect parameters to syscall
The tst-rlimit/tst-rlimit64 tests pointed to several issueses in prlimit() function for 32-bit CPUs. This patch adds name redirection to prlimit64 in prlimit declaration to provide correct support for 64-bit offset (_FILE_OFFSET_BITS=64) on 32-bit CPUs and fixes improper field assignment and incorrect syscall paramerets in the prlimit() function. Fixes: 8c2f6218 ("setrlimit/getrlimit: fix prlimit64 syscall use for 32-bit CPUs") Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
Diffstat (limited to 'include')
-rw-r--r--include/sys/resource.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/sys/resource.h b/include/sys/resource.h
index e9fac2c65..a5c69d84e 100644
--- a/include/sys/resource.h
+++ b/include/sys/resource.h
@@ -103,13 +103,25 @@ libc_hidden_proto(setpriority)
#ifdef __USE_GNU
/* Modify and return resource limits of a process atomically. */
+# ifndef __USE_FILE_OFFSET64
extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
- const struct rlimit *__new_limit,
- struct rlimit *__old_limit) __THROW;
-
+ const struct rlimit *__new_limit,
+ struct rlimit *__old_limit) __THROW;
+# else
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
+ enum __rlimit_resource __resource,
+ const struct rlimit *__new_limit,
+ struct rlimit *__old_limit), prlimit64);
+# else
+# define prlimit prlimit64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
const struct rlimit64 *__new_limit,
struct rlimit64 *__old_limit) __THROW;
+# endif
#endif
__END_DECLS