mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
generic glibc: guard pidfd function declarations
They were introduced in 2.36 & 2.39
This commit is contained in:
parent
e716d13555
commit
9d85c79f2f
12
lib/libc/include/generic-glibc/sys/pidfd.h
vendored
12
lib/libc/include/generic-glibc/sys/pidfd.h
vendored
@ -21,6 +21,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <bits/types/siginfo_t.h>
|
||||
|
||||
// zig patch: check target glibc version
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2
|
||||
|
||||
#define PIDFD_NONBLOCK O_NONBLOCK
|
||||
#define PIDFD_THREAD O_EXCL
|
||||
|
||||
@ -45,8 +48,15 @@ extern int pidfd_getfd (int __pidfd, int __targetfd,
|
||||
extern int pidfd_send_signal (int __pidfd, int __sig, siginfo_t *__info,
|
||||
unsigned int __flags) __THROW;
|
||||
|
||||
#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 */
|
||||
|
||||
// zig patch: check target glibc version
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 39) || __GLIBC__ > 2
|
||||
|
||||
/* Query the process ID (PID) from process descriptor FD. Return the PID
|
||||
or -1 in case of an error. */
|
||||
extern pid_t pidfd_getpid (int __fd) __THROW;
|
||||
|
||||
#endif /* _PIDFD_H */
|
||||
#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 36) || __GLIBC__ > 2 */
|
||||
|
||||
#endif /* _PIDFD_H */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user