authorgravatar for hugo.beauzee@datadoghq.comHugo Beauzée-Luyssen <hugo.beauzee@datadoghq.com> 2025-02-05 12:02:26+01:00
committergravatar for hugo.beauzee@datadoghq.comHugo Beauzée-Luyssen <hugo.beauzee@datadoghq.com> 2025-02-06 10:08:12+01:00
logfdef5c564d0ec96b187b43825d485a33ed52c3c3
treef3db7f7009d961de12f279246161775661c7993c
parent62e251dcaa366c15e1e591d859738bb0d735dc9a
signaturebadge-check Signed by SSH key SHA256:f/PN3KBuYCphTMxWTpJsH2vSjX3SRGCBksBuY/gCq10

generic glibc: guard close_range declaration

It is only available starting from glibc 2.34

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

lib/libc/include/generic-glibc/unistd.h+4-1
......@@ -1203,6 +1203,8 @@ int getentropy (void *__buffer, size_t __length) __wur
12031203#endif
12041204
12051205#ifdef __USE_GNU
1206// zig patch: check target glibc version
1207# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
12061208/* Close all file descriptors in the range FD up to MAX_FD. The flag FLAGS
12071209 are define by the CLOSE_RANGE prefix. This function behaves like close
12081210 on the range and gaps where the file descriptor is invalid or errors
......@@ -1210,6 +1212,7 @@ int getentropy (void *__buffer, size_t __length) __wur
12101212 successor or -1 for failure (and sets errno accordingly). */
12111213extern int close_range (unsigned int __fd, unsigned int __max_fd,
12121214 int __flags) __THROW;
1215# endif
12131216#endif
12141217
12151218/* Define some macros helping to catch buffer overflows. */
......@@ -1222,4 +1225,4 @@ extern int close_range (unsigned int __fd, unsigned int __max_fd,
12221225
12231226__END_DECLS
12241227
1225#endif /* unistd.h */
\ No newline at end of file
1228#endif /* unistd.h */