• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision118e211269fb4f685f2999157eb4aafc8fdd9423 (tree)
Zeit2022-02-27 10:40:00
AutorWaldemar Brodkorb <wbx@open...>
CommiterWaldemar Brodkorb

Log Message

guard prlimit, reported by Lance Fredrickson

Ändern Zusammenfassung

Diff

--- a/libc/sysdeps/linux/common/bits/kernel-features.h
+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
@@ -490,6 +490,11 @@
490490 # define __ASSUME_FALLOCATE 1
491491 #endif
492492
493+/* prlimit64 is available in 2.6.36. */
494+#if __LINUX_KERNEL_VERSION >= 0x020624
495+# define __ASSUME_PRLIMIT64 1
496+#endif
497+
493498 /* getcpu is a syscall for x86-64 since 3.1. */
494499 #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
495500 # define __ASSUME_GETCPU_SYSCALL 1
--- a/libc/sysdeps/linux/common/prlimit.c
+++ b/libc/sysdeps/linux/common/prlimit.c
@@ -17,7 +17,9 @@
1717
1818 #include <sys/resource.h>
1919 #include <sysdep.h>
20+#include <bits/kernel-features.h>
2021
22+#if defined __ASSUME_PRLIMIT64
2123 int
2224 prlimit (__pid_t pid, enum __rlimit_resource resource,
2325 const struct rlimit *new_rlimit, struct rlimit *old_rlimit)
@@ -25,3 +27,4 @@ prlimit (__pid_t pid, enum __rlimit_resource resource,
2527 return INLINE_SYSCALL (prlimit64, 4, pid, resource, new_rlimit,
2628 old_rlimit);
2729 }
30+#endif