diff --git a/lib/libc/glibc/io/fcntl.h b/lib/libc/glibc/io/fcntl.h index 9cee0b5900..c44f8b6189 100644 --- a/lib/libc/glibc/io/fcntl.h +++ b/lib/libc/glibc/io/fcntl.h @@ -167,6 +167,10 @@ typedef __pid_t pid_t; effective IDs, not real IDs. */ #endif + +/* fcntl was a simple symbol until glibc 2.27 inclusive. glibc 2.28 onwards + * re-defines it to fcntl64 (via #define) if _FILE_OFFSET_BITS == 64. */ +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2 /* Do the file control operation described by CMD on FD. The remaining arguments are interpreted depending on CMD. @@ -197,6 +201,9 @@ extern int __fcntl_time64 (int __fd, int __request, ...) __THROW; # define fcntl __fcntl_time64 # endif #endif +#else /* glibc 2.27 or lower */ +extern int fcntl (int __fd, int __cmd, ...); +#endif /* Open FILE and return a new file descriptor for it, or -1 on error. OFLAG determines the type of access used. If O_CREAT or O_TMPFILE is set