]> sourceware.org Git - glibc.git/commitdiff
Linux: Add time64 alias for prctl
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:16 +0000 (11:58 +0200)
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
25 files changed:
sysdeps/unix/sysv/linux/Makefile
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/powerpc32/fpu/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
sysdeps/unix/sysv/linux/prctl.c
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
sysdeps/unix/sysv/linux/sys/prctl.h
sysdeps/unix/sysv/linux/tst-prctl-time64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/tst-prctl.c [new file with mode: 0644]

index cceb16be05edacd68dd830493c825f8db4373061..123f15c2e3692dc26aadf0c84ab95270dca225ee 100644 (file)
@@ -120,7 +120,9 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
         tst-timerfd tst-ppoll \
         tst-clock_adjtime tst-adjtimex tst-ntp_adjtime tst-ntp_gettime \
         tst-ntp_gettimex tst-sigtimedwait tst-misalign-clone \
-        tst-close_range
+  tst-close_range \
+  tst-prctl \
+  # tests
 
 # Test for the symbol version of fcntl that was replaced in glibc 2.28.
 ifeq ($(have-GLIBC_2.27)$(build-shared),yesyes)
@@ -138,6 +140,8 @@ tests-time64 += \
   tst-ppoll-time64 \
   tst-sigtimedwait-time64 \
   tst-timerfd-time64 \
+  tst-prctl-time64 \
+  # tests-time64
 
 tests-clone-internal = \
   tst-align-clone-internal \
index 4f0e167dd4e31c9aa3f01fac7c7042c1045fd896..cff3d476da4059d974f7bc24628df782ca5d01c8 100644 (file)
@@ -245,6 +245,7 @@ libc {
     __ntp_gettime64;
     __ntp_gettimex64;
     __ppoll64;
+    __prctl_time64;
     __pselec64;
     __pselect64;
     __pthread_clockjoin_np64;
index 225cd17730c4575ec057ba58b3b15da175fd6085..a108dccfe9c4c3909481dcceb98700052e5102ca 100644 (file)
@@ -240,6 +240,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 3731f38a0b5c302a0796c14edcaf0c789ad4f48d..3511d35f5ebf06c077aa0e01e02860c2442cae9f 100644 (file)
@@ -237,6 +237,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 66782187159af5b060080130c78e533431025fac..40342891a5f929112cdf3df3a16cb53b46727980 100644 (file)
@@ -2396,6 +2396,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 8f105d3de58d726d8311157d3c2c64d892a9aa80..1502aaddd4ac3166d26c9cf94574b6d636b45b53 100644 (file)
@@ -2347,6 +2347,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 53ddabd0210a776362aff411949a0cf4319d4a8f..70a0f7f1c35951e7537a34ed093ed3ab9fe9ea15 100644 (file)
@@ -2531,6 +2531,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 23168e8042fc4f025fa875fb54e886f87665e69e..13ac607c49fb22fc0652bfef14f02605320ef574 100644 (file)
@@ -241,6 +241,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index a63ac5624b47f551f574eb08c6171a0199575409..662a51909551db06d1a49c9a7c25f45f278c88b9 100644 (file)
@@ -2474,6 +2474,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index f9f6dfb8b550f0ba142e12977ce3f0ba79fd1e58..fc0c6b6acc68ea9fd5862897122db95744176f81 100644 (file)
@@ -2447,6 +2447,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 97d03fae0cfaf5c1c001f40f3d1b9837980c5b4c..56a52de04913046606e0b2d0f72e1d744a524f6d 100644 (file)
@@ -2444,6 +2444,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 0deeb17651ecd88e8304b0413ee764c8c0737da8..4aa9e33b7dfaaa879b13a4aa21de6bbb19bc99c6 100644 (file)
@@ -2439,6 +2439,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 55432c52b778129420c8c2eaf4d232d3ad3101f0..1c1227301b1292f4c2782c24a1e419d5dc840302 100644 (file)
@@ -2437,6 +2437,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index daa0d49906fc73ee58475e6e15a2a53d8ad251ac..876893455e965d4d23334110ec23ca85e8e7e4c6 100644 (file)
@@ -2445,6 +2445,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 36dcfc8839bb180ceb2bbd2efacac820e5ded6be..dc41e174876b3acb91f182b25255b1c286b6892d 100644 (file)
@@ -2486,6 +2486,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 8283409237cef65332f38b2e552556e5d85b4ede..9e3311a978bcc386b020176dd7e59a3aae293e6d 100644 (file)
@@ -2501,6 +2501,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 590eda0af6520d95859067e37fdc125471ae6354..2ac6aa068f7696dcb62df1be5d526afe2e7e799d 100644 (file)
@@ -2534,6 +2534,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 85ad4cdd835eada5d9193eb528fca2df1cfeef78..2af7b307ef9d8344e832502979da5af01b0a2278 100644 (file)
@@ -40,3 +40,6 @@ __prctl (int option, ...)
 
 libc_hidden_def (__prctl)
 weak_alias (__prctl, prctl)
+#if __TIMESIZE != 64
+weak_alias (__prctl, __prctl_time64)
+#endif
index 08b02158a10f8ddc2289d9766befd9a61be18369..644f6b734c2df635b5aac0e5a6af6b56f9804a5d 100644 (file)
@@ -2499,6 +2499,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 416db82cbd66218952efc543f210fa0736960f6d..369dccc4af5696c1293c5f930d7632aa0e89e071 100644 (file)
@@ -2354,6 +2354,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index 6be813c3dbf1a339a63224b13c17574515b5a949..4254360898a811e93ac203af949a5a82db5c2e16 100644 (file)
@@ -2351,6 +2351,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index ce61dd955604ae95e33db1faf3d7bd29727e6c81..31f43ed41436c6ad35d0b47b56bba40f9e6760f1 100644 (file)
@@ -2494,6 +2494,7 @@ GLIBC_2.34 __nftw64_time64 F
 GLIBC_2.34 __ntp_gettime64 F
 GLIBC_2.34 __ntp_gettimex64 F
 GLIBC_2.34 __ppoll64 F
+GLIBC_2.34 __prctl_time64 F
 GLIBC_2.34 __pselect64 F
 GLIBC_2.34 __pthread_cleanup_routine F
 GLIBC_2.34 __pthread_clockjoin_np64 F
index c9048c7cdb3e4d2654c74ec32599f6e4a8f8fee5..db88938b3a542b0b915dbebac315db6fbc294354 100644 (file)
 __BEGIN_DECLS
 
 /* Control process execution.  */
+#ifndef __USE_TIME_BITS64
 extern int prctl (int __option, ...) __THROW;
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (prctl, (int __option, ...), __prctl_time64) __THROW;
+# else
+extern int __prctl_time64 (int __option,d ...) __THROW;
+#  define ioctl __prctl_time64
+# endif
+#endif
+
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/tst-prctl-time64.c b/sysdeps/unix/sysv/linux/tst-prctl-time64.c
new file mode 100644 (file)
index 0000000..d233e12
--- /dev/null
@@ -0,0 +1 @@
+#include "tst-prctl.c"
diff --git a/sysdeps/unix/sysv/linux/tst-prctl.c b/sysdeps/unix/sysv/linux/tst-prctl.c
new file mode 100644 (file)
index 0000000..a9dd1dc
--- /dev/null
@@ -0,0 +1,33 @@
+/* Smoke test for prctl.
+   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 <sys/prctl.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+  TEST_COMPARE (prctl (PR_SET_NAME, "thread name", 0, 0, 0), 0);
+  char buffer[16] = { 0, };
+  TEST_COMPARE (prctl (PR_GET_NAME, buffer, 0, 0, 0), 0);
+  char expected[16] = "thread name";
+  TEST_COMPARE_BLOB (buffer, sizeof (buffer), expected, sizeof (expected));
+  return 0;
+}
+
+#include <support/test-driver.c>
This page took 0.083822 seconds and 5 git commands to generate.