authorgravatar for hugo.beauzee@datadoghq.comHugo Beauzée-Luyssen <hugo.beauzee@datadoghq.com> 2025-02-05 14:24:09+01:00
committergravatar for hugo.beauzee@datadoghq.comHugo Beauzée-Luyssen <hugo.beauzee@datadoghq.com> 2025-02-06 18:00:44+01:00
log9d85c79f2f09c3db578cc145392099d901986eb4
treed24774235b57941fee02f9d2c526ea8c60b45f9d
parente716d135557106410cdd46f01b865eaab3938fd5
signaturebadge-check Signed by SSH key SHA256:f/PN3KBuYCphTMxWTpJsH2vSjX3SRGCBksBuY/gCq10

generic glibc: guard pidfd function declarations

They were introduced in 2.36 & 2.39

1 files changed, 11 insertions(+), 1 deletions(-)

  • folderlib
lib/libc/include/generic-glibc/sys/pidfd.h+11-1
...@@ -21,6 +21,9 @@...@@ -21,6 +21,9 @@
21#include <fcntl.h>21#include <fcntl.h>
22#include <bits/types/siginfo_t.h>22#include <bits/types/siginfo_t.h>
2323
24// zig patch: check target glibc version
25#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2
26
24#define PIDFD_NONBLOCK O_NONBLOCK27#define PIDFD_NONBLOCK O_NONBLOCK
25#define PIDFD_THREAD O_EXCL28#define PIDFD_THREAD O_EXCL
2629
...@@ -45,8 +48,15 @@ extern int pidfd_getfd (int __pidfd, int __targetfd,...@@ -45,8 +48,15 @@ extern int pidfd_getfd (int __pidfd, int __targetfd,
45extern int pidfd_send_signal (int __pidfd, int __sig, siginfo_t *__info,48extern int pidfd_send_signal (int __pidfd, int __sig, siginfo_t *__info,
46 unsigned int __flags) __THROW;49 unsigned int __flags) __THROW;
4750
51#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 */
52
53// zig patch: check target glibc version
54#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 39) || __GLIBC__ > 2
55
48/* Query the process ID (PID) from process descriptor FD. Return the PID56/* Query the process ID (PID) from process descriptor FD. Return the PID
49 or -1 in case of an error. */57 or -1 in case of an error. */
50extern pid_t pidfd_getpid (int __fd) __THROW;58extern pid_t pidfd_getpid (int __fd) __THROW;
5159
52#endif /* _PIDFD_H */
\ No newline at end of file
60#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 */
61
62#endif /* _PIDFD_H */