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
signature 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...@@ -1203,6 +1203,8 @@ int getentropy (void *__buffer, size_t __length) __wur
1203#endif1203#endif
12041204
1205#ifdef __USE_GNU1205#ifdef __USE_GNU
1206// zig patch: check target glibc version
1207# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
1206/* Close all file descriptors in the range FD up to MAX_FD. The flag FLAGS1208/* Close all file descriptors in the range FD up to MAX_FD. The flag FLAGS
1207 are define by the CLOSE_RANGE prefix. This function behaves like close1209 are define by the CLOSE_RANGE prefix. This function behaves like close
1208 on the range and gaps where the file descriptor is invalid or errors1210 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...@@ -1210,6 +1212,7 @@ int getentropy (void *__buffer, size_t __length) __wur
1210 successor or -1 for failure (and sets errno accordingly). */1212 successor or -1 for failure (and sets errno accordingly). */
1211extern int close_range (unsigned int __fd, unsigned int __max_fd,1213extern int close_range (unsigned int __fd, unsigned int __max_fd,
1212 int __flags) __THROW;1214 int __flags) __THROW;
1215# endif
1213#endif1216#endif
12141217
1215/* Define some macros helping to catch buffer overflows. */1218/* Define some macros helping to catch buffer overflows. */
...@@ -1222,4 +1225,4 @@ extern int close_range (unsigned int __fd, unsigned int __max_fd,...@@ -1222,4 +1225,4 @@ extern int close_range (unsigned int __fd, unsigned int __max_fd,
12221225
1223__END_DECLS1226__END_DECLS
12241227
1225#endif /* unistd.h */
\ No newline at end of file
1228#endif /* unistd.h */