[2/8] io: Add time64 alias for fcntl

Message ID 776858146560e1148ce0bad55097f88f441dcdb6.1626708388.git.fweimer@redhat.com
State Committed
Headers
Series Additional time64 system call wrappers |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Florian Weimer July 19, 2021, 3:28 p.m. UTC
  ---
 io/Makefile                                   |  2 ++
 io/fcntl.h                                    | 27 ++++++++++++++-----
 io/tst-fcntl-time64.c                         |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/fcntl64.c             |  3 +++
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  1 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  1 +
 .../sysv/linux/microblaze/be/libc.abilist     |  1 +
 .../sysv/linux/microblaze/le/libc.abilist     |  1 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  1 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  1 +
 23 files changed, 45 insertions(+), 7 deletions(-)
 create mode 100644 io/tst-fcntl-time64.c
  

Patch

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"
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index bfb5d09693..225cd17730 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -203,6 +203,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index cd64167174..3731f38a0b 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -200,6 +200,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 121e5ad9f5..6678218715 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2359,6 +2359,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/fcntl64.c b/sysdeps/unix/sysv/linux/fcntl64.c
index ed19c327b9..e65233de4b 100644
--- a/sysdeps/unix/sysv/linux/fcntl64.c
+++ b/sysdeps/unix/sysv/linux/fcntl64.c
@@ -54,6 +54,9 @@  libc_hidden_def (__libc_fcntl64)
 weak_alias (__libc_fcntl64, __fcntl64)
 libc_hidden_weak (__fcntl64)
 weak_alias (__libc_fcntl64, fcntl64)
+#if __TIMESIZE != 64
+weak_alias (__libc_fcntl64, __fcntl_time64)
+#endif
 
 #ifdef __OFF_T_MATCHES_OFF64_T
 weak_alias (__libc_fcntl64, __libc_fcntl)
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 1ef566907a..8f105d3de5 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2310,6 +2310,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 287cd4e574..53ddabd021 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2493,6 +2493,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index f01a129159..23168e8042 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -204,6 +204,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index beb2453809..a63ac5624b 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2437,6 +2437,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 5ab2304162..f9f6dfb8b5 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2410,6 +2410,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index c3a61c96f0..97d03fae0c 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2407,6 +2407,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 1e66953b64..0deeb17651 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2402,6 +2402,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index cd26df6cc0..55432c52b7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2400,6 +2400,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index a5002c8f67..daa0d49906 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2408,6 +2408,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 04f33cafcb..36dcfc8839 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2449,6 +2449,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 089577f914..8283409237 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2464,6 +2464,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index fc97125521..590eda0af6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2497,6 +2497,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index e16ddd9010..08b02158a1 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2462,6 +2462,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 343784350d..416db82cbd 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2317,6 +2317,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index 4e7c6bac01..6be813c3db 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2314,6 +2314,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 9274380630..ce61dd9556 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2457,6 +2457,7 @@  GLIBC_2.34 __cnd_timedwait64 F
 GLIBC_2.34 __ctime64 F
 GLIBC_2.34 __ctime64_r F
 GLIBC_2.34 __difftime64 F
+GLIBC_2.34 __fcntl_time64 F
 GLIBC_2.34 __fstat64_time64 F
 GLIBC_2.34 __fstatat64_time64 F
 GLIBC_2.34 __fts64_children_time64 F