about summary refs log tree commit diff
path: root/io
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-07-21 11:42:31 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-07-21 11:58:16 +0200
commit8a40aff86ba5f64a3a84883e539cb67bd48db030 (patch)
treea780670b42c8cb18516bb7e952971292e0780978 /io
parent82c395d91ea4f69120d453aeec398e3042cad5fc (diff)
downloadglibc-8a40aff86ba5f64a3a84883e539cb67bd48db030.tar.gz
glibc-8a40aff86ba5f64a3a84883e539cb67bd48db030.tar.xz
glibc-8a40aff86ba5f64a3a84883e539cb67bd48db030.zip
io: Add time64 alias for fcntl
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'io')
-rw-r--r--io/Makefile2
-rw-r--r--io/fcntl.h27
-rw-r--r--io/tst-fcntl-time64.c1
3 files changed, 23 insertions, 7 deletions
diff --git a/io/Makefile b/io/Makefile
index ebb7d56d67..9871ecbc74 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -90,6 +90,8 @@ tests-time64 := \
   tst-utime-time64 \
   tst-utimensat-time64 \
   tst-utimes-time64 \
+  tst-fcntl-time64 \
+  # tests-time64
 
 # Likewise for statx, but we do not need static linking here.
 tests-internal += tst-statx tst-file_change_detection
diff --git a/io/fcntl.h b/io/fcntl.h
index f3b5e0ef77..8917a73b42 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -172,17 +172,30 @@ typedef __pid_t pid_t;
 
    This function is a cancellation point and therefore not marked with
    __THROW.  */
-#ifndef __USE_FILE_OFFSET64
+#ifndef __USE_TIME_BITS64
+# ifndef __USE_FILE_OFFSET64
 extern int fcntl (int __fd, int __cmd, ...);
-#else
-# ifdef __REDIRECT
-extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
 # else
-#  define fcntl fcntl64
+#  ifdef __REDIRECT
+extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
+#  else
+#   define fcntl fcntl64
+#  endif
 # endif
-#endif
-#ifdef __USE_LARGEFILE64
+# ifdef __USE_LARGEFILE64
 extern int fcntl64 (int __fd, int __cmd, ...);
+# endif
+#else /* __USE_TIME_BITS64 */
+# ifdef __REDIRECT
+extern int __REDIRECT (fcntl, (int __fd, int __request, ...),
+		       __fcntl_time64)  __THROW;
+extern int __REDIRECT (fcntl64, (int __fd, int __request, ...),
+		       __fcntl_time64)  __THROW;
+# else
+extern int __fcntl_time64 (int __fd, int __request, ...) __THROW;
+#  define fcntl64 __fcntl_time64
+#  define fcntl __fcntl_time64
+# endif
 #endif
 
 /* Open FILE and return a new file descriptor for it, or -1 on error.
diff --git a/io/tst-fcntl-time64.c b/io/tst-fcntl-time64.c
new file mode 100644
index 0000000000..ef4a5182cb
--- /dev/null
+++ b/io/tst-fcntl-time64.c
@@ -0,0 +1 @@
+#include "tst-fcntl.c"