Revision | 118e211269fb4f685f2999157eb4aafc8fdd9423 (tree) |
---|---|
Zeit | 2022-02-27 10:40:00 |
Autor | Waldemar Brodkorb <wbx@open...> |
Commiter | Waldemar Brodkorb |
guard prlimit, reported by Lance Fredrickson
@@ -490,6 +490,11 @@ | ||
490 | 490 | # define __ASSUME_FALLOCATE 1 |
491 | 491 | #endif |
492 | 492 | |
493 | +/* prlimit64 is available in 2.6.36. */ | |
494 | +#if __LINUX_KERNEL_VERSION >= 0x020624 | |
495 | +# define __ASSUME_PRLIMIT64 1 | |
496 | +#endif | |
497 | + | |
493 | 498 | /* getcpu is a syscall for x86-64 since 3.1. */ |
494 | 499 | #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100 |
495 | 500 | # define __ASSUME_GETCPU_SYSCALL 1 |
@@ -17,7 +17,9 @@ | ||
17 | 17 | |
18 | 18 | #include <sys/resource.h> |
19 | 19 | #include <sysdep.h> |
20 | +#include <bits/kernel-features.h> | |
20 | 21 | |
22 | +#if defined __ASSUME_PRLIMIT64 | |
21 | 23 | int |
22 | 24 | prlimit (__pid_t pid, enum __rlimit_resource resource, |
23 | 25 | const struct rlimit *new_rlimit, struct rlimit *old_rlimit) |
@@ -25,3 +27,4 @@ prlimit (__pid_t pid, enum __rlimit_resource resource, | ||
25 | 27 | return INLINE_SYSCALL (prlimit64, 4, pid, resource, new_rlimit, |
26 | 28 | old_rlimit); |
27 | 29 | } |
30 | +#endif |