]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
misc: Add time64 alias for ioctl
authorFlorian Weimer <fweimer@redhat.com>
Wed, 21 Jul 2021 09:42:31 +0000 (11:42 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 21 Jul 2021 09:58:09 +0000 (11:58 +0200)
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
26 files changed:
misc/Makefile
misc/sys/ioctl.h
misc/tst-ioctl-time64.c [new file with mode: 0644]
misc/tst-ioctl.c [new file with mode: 0644]
sysdeps/unix/syscalls.list
sysdeps/unix/sysv/linux/Versions
sysdeps/unix/sysv/linux/arm/be/libc.abilist
sysdeps/unix/sysv/linux/arm/le/libc.abilist
sysdeps/unix/sysv/linux/csky/libc.abilist
sysdeps/unix/sysv/linux/hppa/libc.abilist
sysdeps/unix/sysv/linux/i386/libc.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
sysdeps/unix/sysv/linux/nios2/libc.abilist
sysdeps/unix/sysv/linux/powerpc/ioctl.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
sysdeps/unix/sysv/linux/sh/be/libc.abilist
sysdeps/unix/sysv/linux/sh/le/libc.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist

index ae03e26f1b5b447a53a57e1bf991d7467171ab23..22923efde914da589e44e92e67ad90b791d9d9fe 100644 (file)
@@ -88,11 +88,14 @@ tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
         tst-preadvwritev tst-preadvwritev64 tst-makedev tst-empty \
         tst-preadvwritev2 tst-preadvwritev64v2 tst-warn-wide \
         tst-ldbl-warn tst-ldbl-error tst-dbl-efgcvt tst-ldbl-efgcvt \
-        tst-mntent-autofs tst-syscalls tst-mntent-escape tst-select
+        tst-mntent-autofs tst-syscalls tst-mntent-escape tst-select \
+        tst-ioctl
 
 tests-time64 := \
   tst-select-time64 \
-  tst-pselect-time64
+  tst-pselect-time64 \
+  tst-ioctl-time64 \
+  # tests-time64
 
 # Tests which need libdl.
 ifeq (yes,$(build-shared))
index ddd204d95f0931d84ee5fe31d2e1ea6f81717ff0..6884d9925f06125fefef4797d9650a06f7ebbc61 100644 (file)
@@ -38,7 +38,17 @@ __BEGIN_DECLS
 /* Perform the I/O control operation specified by REQUEST on FD.
    One argument may follow; its presence and type depend on REQUEST.
    Return value depends on REQUEST.  Usually -1 indicates error.  */
+#ifndef __USE_TIME_BITS64
 extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (ioctl, (int __fd, unsigned long int __request, ...),
+                      __ioctl_time64) __THROW;
+# else
+extern int __ioctl_time64 (int __fd, unsigned long int __request, ...) __THROW;
+#  define ioctl __ioctl_time64
+# endif
+#endif
 
 __END_DECLS
 
diff --git a/misc/tst-ioctl-time64.c b/misc/tst-ioctl-time64.c
new file mode 100644 (file)
index 0000000..c73e8f6
--- /dev/null
@@ -0,0 +1 @@
+#include "tst-ioctl.c"
diff --git a/misc/tst-ioctl.c b/misc/tst-ioctl.c
new file mode 100644 (file)
index 0000000..a09b8ae
--- /dev/null
@@ -0,0 +1,41 @@
+/* Smoke test for ioctl.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <support/check.h>
+#include <support/xunistd.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+
+static int
+do_test (void)
+{
+  int pair[2];
+  TEST_COMPARE (socketpair (AF_UNIX, SOCK_STREAM, 0, pair), 0);
+  TEST_COMPARE (write (pair[0], "buffer", sizeof ("buffer")),
+                sizeof ("buffer"));
+  int value;
+  TEST_COMPARE (ioctl (pair[1], FIONREAD, &value), 0);
+  TEST_COMPARE (value, sizeof ("buffer"));
+  TEST_COMPARE (ioctl (pair[0], FIONREAD, &value), 0);
+  TEST_COMPARE (value, 0);
+  xclose (pair[0]);
+  xclose (pair[1]);
+  return 0;
+}
+
+#include <support/test-driver.c>
index 341eec20f1f2e0cf8141538ad68b72f99021ae24..10bd409eef14ad79092d13399ed84601219b4acb 100644 (file)
@@ -32,7 +32,7 @@ getrlimit     -       getrlimit       i:ip    __getrlimit     getrlimit
 getsockname    -       getsockname     i:ibN   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN getsockopt
 getuid         -       getuid          Ei:     __getuid        getuid
-ioctl          -       ioctl           i:iiI   __ioctl         ioctl
+ioctl          -       ioctl           i:iiI   __ioctl         ioctl __ioctl_time64
 kill           -       kill            i:ii    __kill          kill
 link           -       link            i:ss    __link          link
 listen         -       listen          i:ii    __listen        listen
index 48842168251baaa7b9b1939624ac21ecc7dce2cf..a78bf880e0754ce10d4c8b31328b95bca4ff51a0 100644 (file)
@@ -229,6 +229,7 @@ libc {
     __globfree64_time64;
     __gmtime64;
     __gmtime64_r;
+    __ioctl_time64;
     __localtime64;
     __localtime64_r;
     __lstat64_time64;
index 1e736178371e50040487f36044fa23e502ba41bb..bfb5d09693ce6380b21201305def9e50dddd8f37 100644 (file)
@@ -222,6 +222,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 2bd1f4a0f41ddb772a62f9fb489a41b32d20688e..cd64167174289bf5768aa266007de34935243d67 100644 (file)
@@ -219,6 +219,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 0b3a2310f4b3ee77dfe09166f9d9bfd487561815..121e5ad9f5655ab3d18d545684bbe211bd06fa90 100644 (file)
@@ -2378,6 +2378,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 230eb0c85ae1ebb9b5f9a6f678170c0c6086c18b..1ef566907aa970aae1625f7c9d15ff5b3da5d744 100644 (file)
@@ -2329,6 +2329,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index d58620d817cd54df68972231ed239b30d8571061..287cd4e574e38b7d6bf62ed3ca6e4d7ae97ea9a2 100644 (file)
@@ -2512,6 +2512,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __isnanf128 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
index 9b9d0dff9d4872dfdd31a13052bc825b0763e790..f01a12915983a6b349c638d958a37735a4c94af5 100644 (file)
@@ -223,6 +223,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 6d48dc726c2164f3b6980d078fb05b79fd25b071..beb24538094b20a6de1e76c1c531feebcbf05461 100644 (file)
@@ -2456,6 +2456,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 6abbed158e5ba884679406b064564b0a7e01efec..5ab2304162d80bee16917c7b762d7a2475514797 100644 (file)
@@ -2429,6 +2429,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 8b9ae1f0728b083655c6ca2595fc13e2545feba6..c3a61c96f0082f7fcd3b044e10b85b01a3762df6 100644 (file)
@@ -2426,6 +2426,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 095c2ea5daf4560c03c22d2fc02643f285dd2f4d..1e66953b6492926ba16beac05c9dc874dde9e05a 100644 (file)
@@ -2421,6 +2421,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index bc1a353726a04b9bb693c4e39d5ac1d49e8ef9b8..cd26df6cc0edc995de9b24b52847d63033efa3e6 100644 (file)
@@ -2419,6 +2419,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 63db2192c95fe9b5115acc08455bed2eb4e59140..a5002c8f672e9071521c314e17db16614c22cb86 100644 (file)
@@ -2427,6 +2427,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 2303e129351274d84d0baca529757fe01506631a..04f33cafcbbe394f31998f02561fe3a0eb1f59a0 100644 (file)
@@ -2468,6 +2468,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index 1ee9d19d4d9cabda3a88331ce14a3894053b8e04..a81c7ba54cae9626f0992c9c5d0be5ca09a284ea 100644 (file)
@@ -63,3 +63,6 @@ __ioctl (int fd, unsigned long int request, ...)
 }
 libc_hidden_def (__ioctl)
 weak_alias (__ioctl, ioctl)
+#if __TIMESIZE != 64
+weak_alias (__ioctl, __ioctl_time64)
+#endif
index b51067a81f4d1fa54ad72a579ead6481719a9205..089577f91437f365b05bae21b53906e285c31d39 100644 (file)
@@ -2483,6 +2483,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index c5112da9e5fc975eb9371dc546f54eedfe90231a..fc97125521d0a5318b5b3f4288f8eb3e63822cbf 100644 (file)
@@ -2516,6 +2516,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index f803a1093c44bb4d5274082ad858375396677133..e16ddd9010cae4a3a6c6b3628e8d7d0818c28ee9 100644 (file)
@@ -2481,6 +2481,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index fcb9c99713df185015b5a4617be5189d075b4efa..343784350da21a392560aadf663f93079d6aa3bf 100644 (file)
@@ -2336,6 +2336,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index aa294c768538f7ea5f993c40b3fbb56fed084b89..4e7c6bac01f9cc6f6d721438fbaba4a39e7395c3 100644 (file)
@@ -2333,6 +2333,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F
index f5f6bf24fdbd50f786637b126f298cb42bbd5093..9274380630bd8233e3504945c34df3f2a41d3f42 100644 (file)
@@ -2476,6 +2476,7 @@ GLIBC_2.34 __glob64_time64 F
 GLIBC_2.34 __globfree64_time64 F
 GLIBC_2.34 __gmtime64 F
 GLIBC_2.34 __gmtime64_r F
+GLIBC_2.34 __ioctl_time64 F
 GLIBC_2.34 __libc_start_main F
 GLIBC_2.34 __localtime64 F
 GLIBC_2.34 __localtime64_r F