public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/15] Add some tests and infra changes
@ 2021-03-23 13:44 Adhemerval Zanella
  2021-03-23 13:44 ` [PATCH 01/15] io: Move file timestamps tests out of Linux Adhemerval Zanella
                   ` (14 more replies)
  0 siblings, 15 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

This is a resend of the first part of the 'Add 64 bit time support on
legacy ABIs' patchset [1] rebase against master along with fixes from
comments and some changes for the timestamp tests.  It is also
independent of the 64 bit time support.

The patchset is also based on the recent stat fixes [2], so the
timestamp tests tests can be made generic while still handling the
Linux specific limitations.

[1] https://patchwork.sourceware.org/project/glibc/list/?series=1783
[2] https://patchwork.sourceware.org/project/glibc/list/?series=1878

Adhemerval Zanella (15):
  io: Move file timestamps tests out of Linux
  linux: Add futimes test
  linux: Add lutimes test
  io: Add basic tests for utimensat
  io: Use temporary directory and file for ftwtest-sh
  time: Add getitimer and setitimer basic tests
  time: Add gmtime/gmtime_r tests
  time: Add timegm/timelocal basic tests
  time: Add basic timespec_get tests
  time: Add 64 bit tests for getdate / getdate_r
  posix: Add wait3 tests
  linux: mips: Split libpthread.abilist in n32 and n64
  linux: mips: Split librt.abilist in n32 and n64
  linux: mips: Split libanl.abilist in n32 and n64
  linux: s390: Add libanl.abilist in s390 and s390x

 io/Makefile                                   |   8 +-
 io/ftwtest-sh                                 | 242 +++++++++---------
 .../unix/sysv/linux => io}/tst-futimens.c     |   2 +-
 io/tst-futimes.c                              |  46 ++++
 io/tst-lutimes.c                              |  53 ++++
 {sysdeps/unix/sysv/linux => io}/tst-utime.c   |   2 +-
 .../linux => io}/tst-utimensat-skeleton.c     |   7 +-
 io/tst-utimensat.c                            |  70 +++++
 {sysdeps/unix/sysv/linux => io}/tst-utimes.c  |   2 +-
 posix/Makefile                                |   2 +-
 posix/tst-wait-skeleton.c                     | 209 +++++++++++++++
 posix/tst-wait3.c                             |  22 ++
 posix/tst-wait4.c                             | 193 +-------------
 sysdeps/unix/sysv/linux/Makefile              |   2 +-
 .../mips/mips64/{ => n32}/libanl.abilist      |   0
 .../mips/mips64/{ => n32}/libpthread.abilist  |   0
 .../linux/mips/mips64/{ => n32}/librt.abilist |   0
 .../{s390 => mips/mips64/n64}/libanl.abilist  |   0
 .../linux/mips/mips64/n64/libpthread.abilist  | 214 ++++++++++++++++
 .../sysv/linux/mips/mips64/n64/librt.abilist  |  37 +++
 .../sysv/linux/s390/s390-32/libanl.abilist    |   4 +
 .../sysv/linux/s390/s390-64/libanl.abilist    |   4 +
 time/Makefile                                 |   3 +-
 time/tst-getdate.c                            | 153 ++++++-----
 time/tst-gmtime.c                             | 125 +++++++++
 time/tst-itimer.c                             | 175 +++++++++++++
 time/tst-timegm.c                             |  95 +++++++
 time/tst-timespec_get.c                       |  40 +++
 28 files changed, 1328 insertions(+), 382 deletions(-)
 rename {sysdeps/unix/sysv/linux => io}/tst-futimens.c (96%)
 create mode 100644 io/tst-futimes.c
 create mode 100644 io/tst-lutimes.c
 rename {sysdeps/unix/sysv/linux => io}/tst-utime.c (96%)
 rename {sysdeps/unix/sysv/linux => io}/tst-utimensat-skeleton.c (92%)
 create mode 100644 io/tst-utimensat.c
 rename {sysdeps/unix/sysv/linux => io}/tst-utimes.c (96%)
 create mode 100644 posix/tst-wait-skeleton.c
 create mode 100644 posix/tst-wait3.c
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist (100%)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/librt.abilist (100%)
 rename sysdeps/unix/sysv/linux/{s390 => mips/mips64/n64}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
 create mode 100644 time/tst-gmtime.c
 create mode 100644 time/tst-itimer.c
 create mode 100644 time/tst-timegm.c
 create mode 100644 time/tst-timespec_get.c

-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 01/15] io: Move file timestamps tests out of Linux
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  5:04   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 02/15] linux: Add futimes test Adhemerval Zanella
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

Now that libsupport abstract Linux possible missing support (either
due FS limitation that can't handle 64 bit timestamp or architectures
that do not handle values larger than unsigned 32 bit values) the
tests can be turned generic.

Checked on x86_64-linux-gnu and i686-linux-gnu.  I also built the
tests for i686-gnu.
---
 io/Makefile                                              | 5 ++++-
 {sysdeps/unix/sysv/linux => io}/tst-futimens.c           | 0
 {sysdeps/unix/sysv/linux => io}/tst-utime.c              | 0
 {sysdeps/unix/sysv/linux => io}/tst-utimensat-skeleton.c | 0
 {sysdeps/unix/sysv/linux => io}/tst-utimes.c             | 0
 sysdeps/unix/sysv/linux/Makefile                         | 2 +-
 6 files changed, 5 insertions(+), 2 deletions(-)
 rename {sysdeps/unix/sysv/linux => io}/tst-futimens.c (100%)
 rename {sysdeps/unix/sysv/linux => io}/tst-utime.c (100%)
 rename {sysdeps/unix/sysv/linux => io}/tst-utimensat-skeleton.c (100%)
 rename {sysdeps/unix/sysv/linux => io}/tst-utimes.c (100%)

diff --git a/io/Makefile b/io/Makefile
index c9919d666f..3411573cf3 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -68,7 +68,10 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-fts tst-fts-lfs tst-open-tmpfile \
 		   tst-copy_file_range tst-getcwd-abspath tst-lockf \
 		   tst-ftw-lnk tst-file_change_detection tst-lchmod \
-		   tst-ftw-bz26353 tst-stat tst-stat-lfs
+		   tst-ftw-bz26353 tst-stat tst-stat-lfs \
+		   tst-utime \
+		   tst-utimes \
+		   tst-futimens \
 
 # Likewise for statx, but we do not need static linking here.
 tests-internal += tst-statx
diff --git a/sysdeps/unix/sysv/linux/tst-futimens.c b/io/tst-futimens.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-futimens.c
rename to io/tst-futimens.c
diff --git a/sysdeps/unix/sysv/linux/tst-utime.c b/io/tst-utime.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-utime.c
rename to io/tst-utime.c
diff --git a/sysdeps/unix/sysv/linux/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-utimensat-skeleton.c
rename to io/tst-utimensat-skeleton.c
diff --git a/sysdeps/unix/sysv/linux/tst-utimes.c b/io/tst-utimes.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-utimes.c
rename to io/tst-utimes.c
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index e42bc7f13b..aa1e4e991e 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -107,7 +107,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
 	 test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
 	 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
 	 tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \
-	 tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \
+	 tst-timerfd tst-ppoll \
 	 tst-clock_adjtime tst-adjtimex tst-ntp_adjtime
 
 # Test for the symbol version of fcntl that was replaced in glibc 2.28.
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 02/15] linux: Add futimes test
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
  2021-03-23 13:44 ` [PATCH 01/15] io: Move file timestamps tests out of Linux Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  5:07   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 03/15] linux: Add lutimes test Adhemerval Zanella
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

It uses stat to compare against the values set by futimes.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 io/Makefile      |  1 +
 io/tst-futimes.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 io/tst-futimes.c

diff --git a/io/Makefile b/io/Makefile
index 3411573cf3..0002e108a6 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -71,6 +71,7 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-ftw-bz26353 tst-stat tst-stat-lfs \
 		   tst-utime \
 		   tst-utimes \
+		   tst-futimes \
 		   tst-futimens \
 
 # Likewise for statx, but we do not need static linking here.
diff --git a/io/tst-futimes.c b/io/tst-futimes.c
new file mode 100644
index 0000000000..ea7ac7d5f8
--- /dev/null
+++ b/io/tst-futimes.c
@@ -0,0 +1,46 @@
+/* Test for futimes.
+   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/stat.h>
+#include <sys/time.h>
+
+static int
+test_futimens_helper (const char *file, int fd, const struct timeval *tv)
+{
+  int r = futimes (fd, tv);
+  TEST_VERIFY_EXIT (r == 0);
+
+  struct stat64 st;
+  xfstat (fd, &st);
+
+  /* Check if seconds for atime match */
+  TEST_COMPARE (st.st_atime, tv[0].tv_sec);
+
+  /* Check if seconds for mtime match */
+  TEST_COMPARE (st.st_mtime, tv[1].tv_sec);
+
+  return 0;
+}
+
+#define TEST_CALL(fname, fd, v1, v2) \
+  test_futimens_helper (fname, fd, (struct timeval[]) { { v1, 0 }, \
+							{ v2, 0 } })
+
+#include "tst-utimensat-skeleton.c"
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 03/15] linux: Add lutimes test
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
  2021-03-23 13:44 ` [PATCH 01/15] io: Move file timestamps tests out of Linux Adhemerval Zanella
  2021-03-23 13:44 ` [PATCH 02/15] linux: Add futimes test Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  5:25   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 04/15] io: Add basic tests for utimensat Adhemerval Zanella
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

It uses stat to compare against the values set by lutimes.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 io/Makefile                 |  1 +
 io/tst-futimens.c           |  2 +-
 io/tst-futimes.c            |  2 +-
 io/tst-lutimes.c            | 53 +++++++++++++++++++++++++++++++++++++
 io/tst-utime.c              |  2 +-
 io/tst-utimensat-skeleton.c |  7 ++++-
 io/tst-utimes.c             |  2 +-
 7 files changed, 64 insertions(+), 5 deletions(-)
 create mode 100644 io/tst-lutimes.c

diff --git a/io/Makefile b/io/Makefile
index 0002e108a6..bec0e5871e 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -72,6 +72,7 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-utime \
 		   tst-utimes \
 		   tst-futimes \
+		   tst-lutimes \
 		   tst-futimens \
 
 # Likewise for statx, but we do not need static linking here.
diff --git a/io/tst-futimens.c b/io/tst-futimens.c
index ac7a980017..b3e3f3137f 100644
--- a/io/tst-futimens.c
+++ b/io/tst-futimens.c
@@ -38,7 +38,7 @@ test_futimens_helper (const char *file, int fd, const struct timespec *ts)
   return 0;
 }
 
-#define TEST_CALL(fname, fd, v1, v2) \
+#define TEST_CALL(fname, fd, lname, v1, v2) \
   test_futimens_helper (fname, fd, (struct timespec[]) { { v1, 0 }, \
 							 { v2, 0 } })
 
diff --git a/io/tst-futimes.c b/io/tst-futimes.c
index ea7ac7d5f8..bdef38d7cb 100644
--- a/io/tst-futimes.c
+++ b/io/tst-futimes.c
@@ -39,7 +39,7 @@ test_futimens_helper (const char *file, int fd, const struct timeval *tv)
   return 0;
 }
 
-#define TEST_CALL(fname, fd, v1, v2) \
+#define TEST_CALL(fname, fd, lname, v1, v2) \
   test_futimens_helper (fname, fd, (struct timeval[]) { { v1, 0 }, \
 							{ v2, 0 } })
 
diff --git a/io/tst-lutimes.c b/io/tst-lutimes.c
new file mode 100644
index 0000000000..b2da3c5796
--- /dev/null
+++ b/io/tst-lutimes.c
@@ -0,0 +1,53 @@
+/* Test for lutimes.
+   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/stat.h>
+#include <sys/time.h>
+
+static int
+test_lutimes_helper (const char *testfile, int fd, const char *testlink,
+                     const struct timeval *tv)
+{
+  struct stat64 stfile_orig;
+  xlstat (testfile, &stfile_orig);
+
+  TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0);
+
+  struct stat64 stlink;
+  xlstat (testlink, &stlink);
+
+  TEST_COMPARE (stlink.st_atime, tv[0].tv_sec);
+  TEST_COMPARE (stlink.st_mtime, tv[1].tv_sec);
+
+  /* Check if the timestamp from original file is not changed.  */
+  struct stat64 stfile;
+  xlstat (testfile, &stfile);
+
+  TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
+  TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime);
+
+  return 0;
+}
+
+#define TEST_CALL(fname, fd, lname, v1, v2) \
+  test_lutimes_helper (fname, fd, lname, (struct timeval[]) { { v1, 0 }, \
+                                                              { v2, 0 } })
+
+#include "tst-utimensat-skeleton.c"
diff --git a/io/tst-utime.c b/io/tst-utime.c
index c1c7e75a29..6269ef7929 100644
--- a/io/tst-utime.c
+++ b/io/tst-utime.c
@@ -39,7 +39,7 @@ test_utime_helper (const char *file, int fd, const struct utimbuf *ut)
   return 0;
 }
 
-#define TEST_CALL(fname, fd, v1, v2) \
+#define TEST_CALL(fname, fd, lname, v1, v2) \
   test_utime_helper (fname, fd, &(struct utimbuf) { (v1), (v2) })
 
 #include "tst-utimensat-skeleton.c"
diff --git a/io/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c
index 3589146db5..ad9f6763c5 100644
--- a/io/tst-utimensat-skeleton.c
+++ b/io/tst-utimensat-skeleton.c
@@ -24,6 +24,7 @@
 
 static int temp_fd = -1;
 static char *testfile;
+static char *testlink;
 
 const static struct {
   int64_t v1;
@@ -49,6 +50,10 @@ do_prepare (int argc, char *argv[])
 {
   temp_fd = create_temp_file ("utime", &testfile);
   TEST_VERIFY_EXIT (temp_fd > 0);
+
+  testlink = xasprintf ("%s-symlink", testfile);
+  xsymlink (testfile, testlink);
+  add_temp_file (testlink);
 }
 
 static int
@@ -82,7 +87,7 @@ do_test (void)
 	  continue;
 	}
 
-      TEST_CALL (testfile, temp_fd, tests[i].v1, tests[i].v2);
+      TEST_CALL (testfile, temp_fd, testlink, tests[i].v1, tests[i].v2);
     }
 
   return 0;
diff --git a/io/tst-utimes.c b/io/tst-utimes.c
index ba710508b7..991ab0c7d3 100644
--- a/io/tst-utimes.c
+++ b/io/tst-utimes.c
@@ -40,7 +40,7 @@ test_utimes_helper (const char *file, int fd, const struct timeval *tv)
   return 0;
 }
 
-#define TEST_CALL(fname, fd, v1, v2) \
+#define TEST_CALL(fname, fd, lname, v1, v2) \
   test_utimes_helper (fname, fd, (struct timeval[]) { { v1, 0 }, \
 						      { v2, 0 } })
 
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 04/15] io: Add basic tests for utimensat
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (2 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 03/15] linux: Add lutimes test Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  5:33   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

Checked on x86_64-linux-gnu and i686-linux-gnu
---
 io/Makefile        |  1 +
 io/tst-utimensat.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+)
 create mode 100644 io/tst-utimensat.c

diff --git a/io/Makefile b/io/Makefile
index bec0e5871e..0903804dfd 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -74,6 +74,7 @@ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
 		   tst-futimes \
 		   tst-lutimes \
 		   tst-futimens \
+		   tst-utimensat \
 
 # Likewise for statx, but we do not need static linking here.
 tests-internal += tst-statx
diff --git a/io/tst-utimensat.c b/io/tst-utimensat.c
new file mode 100644
index 0000000000..0c7c8470bc
--- /dev/null
+++ b/io/tst-utimensat.c
@@ -0,0 +1,70 @@
+/* Test for utimensat.
+   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 <fcntl.h>
+#include <support/check.h>
+#include <support/xunistd.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+
+static int
+test_utimesat_helper (const char *testfile, int fd, const char *testlink,
+                      const struct timespec *ts)
+{
+  {
+    TEST_VERIFY_EXIT (utimensat (fd, testfile, ts, 0) == 0);
+
+    struct stat64 st;
+    xfstat (fd, &st);
+
+    /* Check if seconds for atime match */
+    TEST_COMPARE (st.st_atime, ts[0].tv_sec);
+
+    /* Check if seconds for mtime match */
+    TEST_COMPARE (st.st_mtime, ts[1].tv_sec);
+  }
+
+  {
+    struct stat64 stfile_orig;
+    xlstat (testfile, &stfile_orig);
+
+    TEST_VERIFY_EXIT (utimensat (0 /* ignored  */, testlink, ts,
+				 AT_SYMLINK_NOFOLLOW)
+		       == 0);
+    struct stat64 stlink;
+    xlstat (testlink, &stlink);
+
+    TEST_COMPARE (stlink.st_atime, ts[0].tv_sec);
+    TEST_COMPARE (stlink.st_mtime, ts[1].tv_sec);
+
+    /* Check if the timestamp from original file is not changed.  */
+    struct stat64 stfile;
+    xlstat (testfile, &stfile);
+
+    TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime);
+    TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime);
+  }
+
+  return 0;
+}
+
+#define TEST_CALL(fname, fd, lname, v1, v2) \
+  test_utimesat_helper (fname, fd, lname, (struct timespec[]) { { v1, 0 }, \
+                                                                { v2, 0 } })
+
+#include "tst-utimensat-skeleton.c"
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (3 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 04/15] io: Add basic tests for utimensat Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-03-23 14:24   ` Andreas Schwab
  2021-04-15  5:46   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 06/15] time: Add getitimer and setitimer basic tests Adhemerval Zanella
                   ` (9 subsequent siblings)
  14 siblings, 2 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

Instead of creating files on glibc source dir.  It also allows run
in parallel.

Checked on x86_64-linux-gnu.
---
 io/ftwtest-sh | 242 +++++++++++++++++++++++++-------------------------
 1 file changed, 119 insertions(+), 123 deletions(-)

diff --git a/io/ftwtest-sh b/io/ftwtest-sh
index a9ae33ff30..b0d1389a73 100644
--- a/io/ftwtest-sh
+++ b/io/ftwtest-sh
@@ -43,15 +43,11 @@ export LC_ALL
 
 # First create our scenario:
 tmp=${objpfx}io
-tmpdir=$tmp/ftwtest.d
+tmpdir=$(mktemp -d $tmp/ftwtest.d.XXXXXX)
+ftwtest=$(basename $tmpdir)
 
 trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 0 1 2 3 15
 
-if test -d $tmpdir; then
-  chmod -fR a+x $tmpdir
-  rm -fr $tmpdir
-fi
-mkdir $tmpdir
 mkdir $tmpdir/foo
 mkdir $tmpdir/bar
 echo > $tmpdir/baz
@@ -67,24 +63,24 @@ ln -s $tmpdir/foo/lvl1/lvl2/lvl3/lvl4 $tmpdir/foo/lvl1/link@1
 echo > $tmpdir/bar/xo
 chmod a-x,a+r $tmpdir/bar
 
-testout=$tmp/ftwtest-tmp.out
+testout=$(mktemp $tmp/ftwtest-tmp-XXXXXX.out)
 
 $testprogram $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_NS, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
 EOF
 rm $testout
 
@@ -92,18 +88,18 @@ $testprogram --depth $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_DP, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_DP, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_DP, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_DP, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_DP, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_DP, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_DP, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_DP, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_DP, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_NS, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_DP, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_DP, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_DP, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
 EOF
 rm $testout
 
@@ -111,20 +107,20 @@ $testprogram --phys $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_NS, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SL, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "link@2", flag = FTW_SL, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "link@3", flag = FTW_SL, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_NS, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SL, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "link@2", flag = FTW_SL, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "link@3", flag = FTW_SL, level = 5
 EOF
 rm $testout
 
@@ -138,73 +134,73 @@ $testprogram --chdir $tmpdir |
 tmpreal=`cd $tmp; pwd -P 2>/dev/null`
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, cwd = $tmpreal/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/ftwtest.d/bar, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, cwd = $tmpreal, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, cwd = $tmpreal/$ftwtest, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/$ftwtest/bar, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2/lvl3, level = 5
 EOF
 rm $testout
 
 curwd=`pwd -P 2>/dev/null`
 cd "$tmp"
-$testprogram --chdir ftwtest.d |
+$testprogram --chdir $ftwtest |
     sort > $testout
 cd "$curwd"
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
-base = "ftwtest.d/", file = "bar", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/", file = "baz", flag = FTW_F, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/", file = "foo", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/ftwtest.d/bar, level = 2
-base = "ftwtest.d/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo, level = 2
-base = "ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
+base = "", file = "$ftwtest", flag = FTW_D, cwd = $tmpreal, level = 0
+base = "$ftwtest/", file = "bar", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/", file = "baz", flag = FTW_F, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/", file = "foo", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/$ftwtest/bar, level = 2
+base = "$ftwtest/foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo, level = 2
+base = "$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2/lvl3, level = 5
 EOF
 rm $testout
 
 curwd=`pwd -P`
 cd "$tmp"
-$testprogram --chdir ftwtest.d/. |
+$testprogram --chdir $ftwtest/. |
     sort > $testout
 cd "$curwd"
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "ftwtest.d/", file = ".", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 0
-base = "ftwtest.d/./", file = "bar", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/./", file = "baz", flag = FTW_F, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/./", file = "foo", flag = FTW_D, cwd = $tmpreal/ftwtest.d, level = 1
-base = "ftwtest.d/./bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/ftwtest.d/bar, level = 2
-base = "ftwtest.d/./foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo, level = 2
-base = "ftwtest.d/./foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/./foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/./foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 3
-base = "ftwtest.d/./foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/./foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2, level = 4
-base = "ftwtest.d/./foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/ftwtest.d/foo/lvl1/lvl2/lvl3, level = 5
+base = "$ftwtest/", file = ".", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 0
+base = "$ftwtest/./", file = "bar", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/./", file = "baz", flag = FTW_F, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/./", file = "foo", flag = FTW_D, cwd = $tmpreal/$ftwtest, level = 1
+base = "$ftwtest/./bar/", file = "xo", flag = FTW_F, cwd = $tmpreal/$ftwtest/bar, level = 2
+base = "$ftwtest/./foo/", file = "lvl1", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo, level = 2
+base = "$ftwtest/./foo/lvl1/", file = "file@1", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/./foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/./foo/lvl1/", file = "lvl2", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 3
+base = "$ftwtest/./foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/./foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2, level = 4
+base = "$ftwtest/./foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, cwd = $tmpreal/$ftwtest/foo/lvl1/lvl2/lvl3, level = 5
 EOF
 rm $testout
 
 curwd=`pwd -P 2>/dev/null`
 cd "$tmp"
-$testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
+$testprogram --chdir $ftwtest/foo/lvl1/link@1 |
     sort > $testout
 cd "$curwd"
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/ftwtest.d/foo/lvl1, level = 0
+base = "$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, cwd = $tmpreal/$ftwtest/foo/lvl1, level = 0
 EOF
 rm $testout
 
@@ -212,7 +208,7 @@ $testprogram --early-exit $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
 succeeded
 EOF
 rm $testout
@@ -226,16 +222,16 @@ $testprogram --skip-subtree=lvl1 $tmpdir |
     sort > $testout
 
 cat <<EOF | diff -u $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
@@ -250,16 +246,16 @@ catcmd=cat
   && catcmd="grep -v lvl1b"
 
 $catcmd <<EOF | diff -u $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
@@ -269,28 +265,28 @@ $testprogram --skip-siblings=file@1b $tmpdir |
 # The filesystem is not required to put file2@1b and file3@1b after file@1b.
 # If file[23]@1b come after file@1b, it shouldn't be printed, while if they
 # come before, they should.
-regexp=`echo $(ls -U $tmp/ftwtest.d/foo/lvl1b \
+regexp=`echo $(ls -U $tmp/$ftwtest/foo/lvl1b \
 	       | sed -n '/file@1b$/,${/file[23]@1b$/p;}') | sed 's, ,|,'`
 catcmd=cat
 [ -n "$regexp" ] && catcmd="egrep -v $regexp"
 
 $catcmd <<EOF | diff -u $testout - || exit 1
-base = "$tmp/", file = "ftwtest.d", flag = FTW_D, level = 0
-base = "$tmp/ftwtest.d/", file = "bar", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/", file = "baz", flag = FTW_F, level = 1
-base = "$tmp/ftwtest.d/", file = "foo", flag = FTW_D, level = 1
-base = "$tmp/ftwtest.d/bar/", file = "xo", flag = FTW_F, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/", file = "lvl1b", flag = FTW_D, level = 2
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
-base = "$tmp/ftwtest.d/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
-base = "$tmp/ftwtest.d/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
+base = "$tmp/", file = "$ftwtest", flag = FTW_D, level = 0
+base = "$tmp/$ftwtest/", file = "bar", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/", file = "baz", flag = FTW_F, level = 1
+base = "$tmp/$ftwtest/", file = "foo", flag = FTW_D, level = 1
+base = "$tmp/$ftwtest/bar/", file = "xo", flag = FTW_F, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/", file = "lvl1b", flag = FTW_D, level = 2
+base = "$tmp/$ftwtest/foo/lvl1/", file = "file@1", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "link@1", flag = FTW_SLN, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/", file = "lvl2", flag = FTW_D, level = 3
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "file@2", flag = FTW_F, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/", file = "lvl3", flag = FTW_D, level = 4
+base = "$tmp/$ftwtest/foo/lvl1/lvl2/lvl3/", file = "file@3", flag = FTW_F, level = 5
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file2@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file3@1b", flag = FTW_F, level = 3
+base = "$tmp/$ftwtest/foo/lvl1b/", file = "file@1b", flag = FTW_F, level = 3
 EOF
 rm $testout
 
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 06/15] time: Add getitimer and setitimer basic tests
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (4 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  5:59   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 07/15] time: Add gmtime/gmtime_r tests Adhemerval Zanella
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 time/Makefile     |   2 +-
 time/tst-itimer.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-itimer.c

diff --git a/time/Makefile b/time/Makefile
index 99b5d42666..91cb02a003 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
 	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
-	   tst-settimeofday
+	   tst-settimeofday tst-itimer
 
 include ../Rules
 
diff --git a/time/tst-itimer.c b/time/tst-itimer.c
new file mode 100644
index 0000000000..e464d6b092
--- /dev/null
+++ b/time/tst-itimer.c
@@ -0,0 +1,175 @@
+/* Basic tests for getitimer and setitimer.
+   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 <array_length.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <support/check.h>
+#include <support/xsignal.h>
+#include <unistd.h>
+#include <time.h>
+
+static sig_atomic_t cnt;
+
+static void
+alrm_handler (int sig)
+{
+  if (++cnt > 3)
+    cnt = 3;
+}
+
+static void
+intr_sleep (int sec)
+{
+  struct timespec ts = { .tv_sec = sec, .tv_nsec = 0 };
+  while (nanosleep (&ts, &ts) == -1 && errno == EINTR)
+    ;
+}
+
+static int
+do_test (void)
+{
+  struct itimerval it, it_old;
+  const int timers[] = { ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF };
+  for (int i = 0; i < array_length (timers); i++)
+    {
+      TEST_COMPARE (getitimer (timers[i], &it), 0);
+
+      /* No timer set, all value should be 0.  */
+      TEST_COMPARE (it.it_interval.tv_sec, 0);
+      TEST_COMPARE (it.it_interval.tv_usec, 0);
+      TEST_COMPARE (it.it_value.tv_sec, 0);
+      TEST_COMPARE (it.it_value.tv_usec, 0);
+
+      it.it_interval.tv_sec = 10;
+      it.it_interval.tv_usec = 20;
+      TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+
+      TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old),
+		    0);
+      /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while
+	 other timers returns setitimer value.  */
+      if (timers[i] == ITIMER_REAL)
+	{
+	  TEST_COMPARE (it_old.it_interval.tv_sec, 0);
+	  TEST_COMPARE (it_old.it_interval.tv_usec, 0);
+	}
+      else
+	{
+	  TEST_COMPARE (it_old.it_interval.tv_sec, 10);
+	  TEST_COMPARE (it_old.it_interval.tv_usec, 20);
+	}
+
+      /* Create a periodic timer and check if the return value is the one
+	 previously set.  */
+      it.it_interval.tv_sec = 10;
+      it.it_interval.tv_usec = 20;
+      it.it_value.tv_sec = 30;
+      it.it_value.tv_usec = 40;
+      TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+
+      TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old),
+		    0);
+      TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec);
+      TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec);
+
+      if (sizeof (time_t) == 4)
+	continue;
+
+      /* Same as before, but with a 64 bit time_t value.  */
+      it.it_interval.tv_sec = (time_t) 0x1ffffffffull;
+      it.it_interval.tv_usec = 20;
+      it.it_value.tv_sec = 0;
+      it.it_value.tv_usec = 0;
+
+      /* Linux does not provide 64 bit time_t support for getitimer and
+	 setitimer on architectures with 32 bit time_t support.  */
+      if (sizeof (__time_t) == 8)
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+	  TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 },
+				   &it_old),
+			0);
+	  /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while other
+	     timers returns setitimer value.  */
+	  if (timers[i] == ITIMER_REAL)
+	    {
+	      TEST_COMPARE (it_old.it_interval.tv_sec, 0ull);
+	      TEST_COMPARE (it_old.it_interval.tv_usec, 0);
+	    }
+	  else
+	    {
+	      TEST_COMPARE (it_old.it_interval.tv_sec, 0x1ffffffffull);
+	      TEST_COMPARE (it_old.it_interval.tv_usec, 20);
+	    }
+	}
+      else
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), -1);
+	  TEST_COMPARE (errno, EOVERFLOW);
+	}
+
+      /* Create a periodic timer and check if the return value is the one
+	 previously set.  */
+      it.it_interval.tv_sec = (time_t) 0x1ffffffffull;
+      it.it_interval.tv_usec = 20;
+      it.it_value.tv_sec = 30;
+      it.it_value.tv_usec = 40;
+      if (sizeof (__time_t) == 8)
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
+
+	  TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 },
+				   &it_old),
+			0);
+	  TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec);
+	  TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec);
+	}
+      else
+	{
+	  TEST_COMPARE (setitimer (timers[i], &it, NULL), -1);
+	  TEST_COMPARE (errno, EOVERFLOW);
+	}
+  }
+
+  {
+    struct sigaction sa = { .sa_handler = alrm_handler, .sa_flags = 0 };
+    sigemptyset (&sa.sa_mask);
+    xsigaction (SIGALRM, &sa, NULL);
+  }
+
+  /* Setup a timer to 0.1s and sleep for 1s and check to 3 signal handler
+     execution.  */
+  it.it_interval.tv_sec = 0;
+  it.it_interval.tv_usec = 100000;
+  it.it_value.tv_sec = 0;
+  it.it_value.tv_usec = 100000;
+
+  /* Check ITIMER_VIRTUAL and ITIMER_PROF would require to generate load
+     and be subject to system load.  */
+  cnt = 0;
+  TEST_COMPARE (setitimer (ITIMER_REAL, &it, NULL), 0);
+  intr_sleep (1);
+  TEST_COMPARE (cnt, 3);
+  TEST_COMPARE (setitimer (ITIMER_REAL, &(struct itimerval) { 0 }, NULL), 0);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 07/15] time: Add gmtime/gmtime_r tests
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (5 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 06/15] time: Add getitimer and setitimer basic tests Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  6:01   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 08/15] time: Add timegm/timelocal basic tests Adhemerval Zanella
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 time/Makefile     |   2 +-
 time/tst-gmtime.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-gmtime.c

diff --git a/time/Makefile b/time/Makefile
index 91cb02a003..a503297527 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
 	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
-	   tst-settimeofday tst-itimer
+	   tst-settimeofday tst-itimer tst-gmtime
 
 include ../Rules
 
diff --git a/time/tst-gmtime.c b/time/tst-gmtime.c
new file mode 100644
index 0000000000..4d09cade79
--- /dev/null
+++ b/time/tst-gmtime.c
@@ -0,0 +1,125 @@
+/* Basic tests for gmtime.
+   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 <time.h>
+#include <stdlib.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+  /* Check if the epoch time can be converted.  */
+  {
+    time_t t = 0;
+    struct tm *tmg = gmtime (&t);
+    TEST_COMPARE (tmg->tm_sec,   0);
+    TEST_COMPARE (tmg->tm_min,   0);
+    TEST_COMPARE (tmg->tm_hour,  0);
+    TEST_COMPARE (tmg->tm_mday,  1);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  70);
+    TEST_COMPARE (tmg->tm_wday,  4);
+    TEST_COMPARE (tmg->tm_yday,  0);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+  {
+    /* Same as before but with gmtime_r.  */
+    time_t t = 0;
+    struct tm tms;
+    struct tm *tmg = gmtime_r (&t, &tms);
+    TEST_VERIFY (tmg == &tms);
+    TEST_COMPARE (tmg->tm_year, 70);
+    TEST_COMPARE (tmg->tm_sec,   0);
+    TEST_COMPARE (tmg->tm_min,   0);
+    TEST_COMPARE (tmg->tm_hour,  0);
+    TEST_COMPARE (tmg->tm_mday,  1);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  70);
+    TEST_COMPARE (tmg->tm_wday,  4);
+    TEST_COMPARE (tmg->tm_yday,  0);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  /* Check if the max time value for 32 bit time_t can be converted.  */
+  {
+    time_t t = 0x7fffffff;
+    struct tm *tmg = gmtime (&t);
+    TEST_COMPARE (tmg->tm_sec,   7);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+  {
+    /* Same as before but with ctime_r.  */
+    time_t t = 0x7fffffff;
+    struct tm tms;
+    struct tm *tmg = gmtime_r (&t, &tms);
+    TEST_VERIFY (tmg == &tms);
+    TEST_COMPARE (tmg->tm_sec,   7);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  if (sizeof (time_t) < 8)
+    return 0;
+
+  {
+    time_t t = (time_t) 0x80000000ull;
+    struct tm *tmg = gmtime (&t);
+    TEST_COMPARE (tmg->tm_sec,   8);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  {
+    time_t t = (time_t) 0x80000000ull;
+    struct tm tms;
+    struct tm *tmg = gmtime_r (&t, &tms);
+    TEST_VERIFY (tmg == &tms);
+    TEST_COMPARE (tmg->tm_sec,   8);
+    TEST_COMPARE (tmg->tm_min,   14);
+    TEST_COMPARE (tmg->tm_hour,  3);
+    TEST_COMPARE (tmg->tm_mday,  19);
+    TEST_COMPARE (tmg->tm_mon,   0);
+    TEST_COMPARE (tmg->tm_year,  138);
+    TEST_COMPARE (tmg->tm_wday,  2);
+    TEST_COMPARE (tmg->tm_yday,  18);
+    TEST_COMPARE (tmg->tm_isdst, 0);
+  }
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 08/15] time: Add timegm/timelocal basic tests
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (6 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 07/15] time: Add gmtime/gmtime_r tests Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-03-23 14:28   ` Andreas Schwab
  2021-03-23 13:44 ` [PATCH 09/15] time: Add basic timespec_get tests Adhemerval Zanella
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

Checked i686-linux-gnu and x86_64-linux-gnu.
---
 time/Makefile     |  2 +-
 time/tst-timegm.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-timegm.c

diff --git a/time/Makefile b/time/Makefile
index a503297527..5fcd40ccbb 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
 	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
-	   tst-settimeofday tst-itimer tst-gmtime
+	   tst-settimeofday tst-itimer tst-gmtime tst-timegm
 
 include ../Rules
 
diff --git a/time/tst-timegm.c b/time/tst-timegm.c
new file mode 100644
index 0000000000..3f4d21951a
--- /dev/null
+++ b/time/tst-timegm.c
@@ -0,0 +1,95 @@
+/* Basic tests for timegm.
+   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 <time.h>
+#include <stdlib.h>
+#include <support/check.h>
+
+static void
+do_test_func (time_t (*func)(struct tm *))
+{
+  {
+    struct tm tmg =
+      {
+	.tm_sec = 0,
+	.tm_min = 0,
+	.tm_hour = 0,
+	.tm_mday = 1,
+	.tm_mon = 0,
+	.tm_year = 70,
+	.tm_wday = 4,
+	.tm_yday = 0,
+	.tm_isdst = 0
+     };
+     time_t t = func (&tmg);
+     TEST_COMPARE (t, 0);
+  }
+
+  {
+    struct tm tmg =
+      {
+	.tm_sec = 7,
+	.tm_min = 14,
+	.tm_hour = 3,
+	.tm_mday = 19,
+	.tm_mon = 0,
+	.tm_year = 138,
+	.tm_wday = 2,
+	.tm_yday = 18,
+	.tm_isdst = 0
+     };
+     time_t t = func (&tmg);
+     TEST_COMPARE (t, 0x7fffffff);
+  }
+
+  if (sizeof (time_t) < 8)
+    return;
+
+  {
+    struct tm tmg =
+      {
+	.tm_sec = 8,
+	.tm_min = 14,
+	.tm_hour = 3,
+	.tm_mday = 19,
+	.tm_mon = 0,
+	.tm_year = 138,
+	.tm_wday = 2,
+	.tm_yday = 18,
+	.tm_isdst = 0
+     };
+     time_t t = func (&tmg);
+     TEST_COMPARE (t, (time_t) 0x80000000ull);
+  }
+}
+
+static int
+do_test (void)
+{
+  do_test_func (timegm);
+
+  /* timelocal is a alias to timegm with the only difference it takes local
+     timezone into account, while timegm takes the input value to be UTC.  */
+  TEST_VERIFY_EXIT (setenv ("TZ", ":", 1) == 0);
+  tzset ();
+  do_test_func (timelocal);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 09/15] time: Add basic timespec_get tests
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (7 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 08/15] time: Add timegm/timelocal basic tests Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  6:08   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 10/15] time: Add 64 bit tests for getdate / getdate_r Adhemerval Zanella
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

Checkec on x86_64-linux-gnu and i686-linux-gnu.
---
 time/Makefile           |  3 ++-
 time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 time/tst-timespec_get.c

diff --git a/time/Makefile b/time/Makefile
index 5fcd40ccbb..e1faeb3921 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -49,7 +49,8 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
 	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
 	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
-	   tst-settimeofday tst-itimer tst-gmtime tst-timegm
+	   tst-settimeofday tst-itimer tst-gmtime tst-timegm \
+	   tst-timespec_get
 
 include ../Rules
 
diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c
new file mode 100644
index 0000000000..7389927db4
--- /dev/null
+++ b/time/tst-timespec_get.c
@@ -0,0 +1,40 @@
+/* Basic tests for timespec_get.
+   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 <time.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+  {
+    struct timespec ts;
+    TEST_COMPARE (timespec_get (&ts, 0), 0);
+  }
+
+  {
+    struct timespec ts;
+    TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC);
+    TEST_VERIFY (ts.tv_nsec >= 0);
+    TEST_VERIFY (ts.tv_nsec < 1000000000);
+  }
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 10/15] time: Add 64 bit tests for getdate / getdate_r
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (8 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 09/15] time: Add basic timespec_get tests Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  6:16   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 11/15] posix: Add wait3 tests Adhemerval Zanella
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

The test is also converted to use libsupport.

Checked on i686-linux-gnu and x86_64-linux-gnu.
---
 time/tst-getdate.c | 153 +++++++++++++++++++++++++++------------------
 1 file changed, 92 insertions(+), 61 deletions(-)

diff --git a/time/tst-getdate.c b/time/tst-getdate.c
index 37ecc4823e..c37ba3083a 100644
--- a/time/tst-getdate.c
+++ b/time/tst-getdate.c
@@ -17,110 +17,141 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <array_length.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <support/check.h>
+#include <support/temp_file.h>
+#include <support/xunistd.h>
 #include <time.h>
 
 static const struct
 {
   const char *str;
   const char *tz;
-  int err;
   struct tm tm;
+  bool time64;
 } tests [] =
 {
-  {"21:01:10 1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"21:01:10    1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"   21:01:10 1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"21:01:10 1999-1-31   ", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"    21:01:10 1999-1-31   ", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}},
-  {"21:01:10 1999-2-28", "Universal", 0, {10, 1, 21, 28, 1, 99, 0, 0, 0}},
-  {"16:30:46 2000-2-29", "Universal", 0, {46, 30,16, 29, 1, 100, 0, 0, 0}},
-  {"01-08-2000 05:06:07", "Europe/Berlin", 0, {7, 6, 5, 1, 7, 100, 0, 0, 0}}
+  {"21:01:10 1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"21:01:10    1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"   21:01:10 1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"21:01:10 1999-1-31   ", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"    21:01:10 1999-1-31   ", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0},
+   false },
+  {"21:01:10 1999-2-28", "Universal", {10, 1, 21, 28, 1, 99, 0, 0, 0},
+   false },
+  {"16:30:46 2000-2-29", "Universal", {46, 30,16, 29, 1, 100, 0, 0, 0},
+   false },
+  {"01-08-2000 05:06:07", "Europe/Berlin", {7, 6, 5, 1, 7, 100, 0, 0, 0},
+   false },
+
+  /* 64 bit time_t tests.  */
+  {"21:01:10 2038-1-31", "Universal", {10, 1, 21, 31, 0, 138, 0, 0, 0},
+   true },
+  {"22:01:10 2048-5-20", "Universal", {10, 1, 22, 20, 4, 148, 0, 0, 0},
+   true },
+  {"01-08-2038 05:06:07", "Europe/Berlin", {7, 6, 5, 1, 7, 138, 0, 0, 0},
+   true },
+  {"20-03-2050 21:30:08", "Europe/Berlin", {8, 30, 21, 20, 2, 150, 0, 0, 0},
+   true }
 };
 
-static void
-report_date_error (int err)
+static const char *
+report_date_error (void)
 {
-  switch(err)
+  switch (getdate_err)
     {
     case 1:
-      printf ("The environment variable DATEMSK is not defined or null.\n");
-      break;
+      return "The environment variable DATEMSK is not defined or null.";
     case 2:
-      printf ("The template file denoted by the DATEMSK environment variable cannot be opened.\n");
-      break;
+      return "The template file denoted by the DATEMSK environment variable "
+	     "cannot be opened.";
     case 3:
-      printf ("Information about the template file cannot retrieved.\n");
-      break;
+      return "Information about the template file cannot retrieved.";
     case 4:
-      printf ("The template file is not a regular file.\n");
-      break;
+      return "The template file is not a regular file.\n";
     case 5:
-      printf ("An I/O error occurred while reading the template file.\n");
-      break;
+      return "An I/O error occurred while reading the template file.";
     case 6:
-      printf ("Not enough memory available to execute the function.\n");
-      break;
+      return "Not enough memory available to execute the function.";
     case 7:
-      printf ("The template file contains no matching template.\n");
-      break;
+      return "The template file contains no matching template.";
     case 8:
-      printf ("The input date is invalid, but would match a template otherwise.\n");
-      break;
+      return "The input date is invalid, but would match a template "
+	      "otherwise.";
     default:
-      printf("Unknown error code.\n");
-      break;
+      return "Unknown error code.";
     }
 }
 
+static char *datemsk;
+static const char datemskstr[] =
+  "%H:%M:%S %F\n"
+  "%d-%m-%Y %T\n";
+
+static void
+do_prepare (int argc, char **argv)
+{
+  int fd = create_temp_file ("tst-chk1.", &datemsk);
+  xwrite (fd, datemskstr, sizeof (datemskstr) - 1);
+
+  setenv ("DATEMSK", datemsk, 1);
+}
+#define PREPARE do_prepare
 
 static int
 do_test (void)
 {
-  int errors = 0;
-  size_t i;
   struct tm *tm;
 
-
-  for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
+  for (int i = 0; i < array_length (tests); ++i)
     {
       setenv ("TZ", tests[i].tz, 1);
 
-      tm = getdate (tests[i].str);
+      int expected_err;
+      if (sizeof (time_t) == 4 && tests[i].time64)
+	expected_err = 8;
+      else
+	expected_err = 0;
 
-      if (getdate_err != tests[i].err)
+      tm = getdate (tests[i].str);
+      TEST_COMPARE (getdate_err, expected_err);
+      if (getdate_err != expected_err)
 	{
-	  printf ("Failure for getdate (\"%s\"):\n", tests[i].str);
-	  printf ("getdate_err should be %d but returned: %d which means:\n",
-		  tests[i].err, getdate_err);
-	  report_date_error (getdate_err);
-	  ++errors;
+	  support_record_failure ();
+	  printf ("%s\n", report_date_error ());
 	}
-      else if (tests[i].tm.tm_mon != tm->tm_mon
-	       || tests[i].tm.tm_year != tm->tm_year
-	       || tests[i].tm.tm_mday != tm->tm_mday
-	       || tests[i].tm.tm_hour != tm->tm_hour
-	       || tests[i].tm.tm_min != tm->tm_min
-	       || tests[i].tm.tm_sec != tm->tm_sec)
+      else if (getdate_err == 0)
+	{
+	  TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon);
+	  TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year);
+	  TEST_COMPARE (tests[i].tm.tm_mday, tm->tm_mday);
+	  TEST_COMPARE (tests[i].tm.tm_hour, tm->tm_hour);
+	  TEST_COMPARE (tests[i].tm.tm_min, tm->tm_min);
+	  TEST_COMPARE (tests[i].tm.tm_sec, tm->tm_sec);
+	}
+
+      struct tm tms;
+      TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err);
+      if (getdate_err == 0)
 	{
-	  printf ("Failure for getdate (\"%s\"):\n", tests[i].str);
-	  printf ("struct tm is:  %d-%d-%d %d:%d:%d\n",
-		  tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
-		  tm->tm_hour, tm->tm_min, tm->tm_sec);
-	  printf ("but should be: %d-%d-%d %d:%d:%d\n",
-		  tests[i].tm.tm_year + 1900, tests[i].tm.tm_mon + 1,
-		  tests[i].tm.tm_mday,
-		  tests[i].tm.tm_hour, tests[i].tm.tm_min, tests[i].tm.tm_sec);
-	  ++errors;
+	  TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon);
+	  TEST_COMPARE (tests[i].tm.tm_year, tms.tm_year);
+	  TEST_COMPARE (tests[i].tm.tm_mday, tms.tm_mday);
+	  TEST_COMPARE (tests[i].tm.tm_hour, tms.tm_hour);
+	  TEST_COMPARE (tests[i].tm.tm_min, tms.tm_min);
+	  TEST_COMPARE (tests[i].tm.tm_sec, tms.tm_sec);
 	}
     }
 
-  if (!errors)
-    printf ("No errors found.\n");
-  return errors != 0;
+  return 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 11/15] posix: Add wait3 tests
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (9 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 10/15] time: Add 64 bit tests for getdate / getdate_r Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  6:26   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

The tst-wait4 is moved to common file and used for wait3
tests.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 posix/Makefile            |   2 +-
 posix/tst-wait-skeleton.c | 209 ++++++++++++++++++++++++++++++++++++++
 posix/tst-wait3.c         |  22 ++++
 posix/tst-wait4.c         | 193 +----------------------------------
 4 files changed, 235 insertions(+), 191 deletions(-)
 create mode 100644 posix/tst-wait-skeleton.c
 create mode 100644 posix/tst-wait3.c

diff --git a/posix/Makefile b/posix/Makefile
index be0c72f0bb..64494557f1 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -84,7 +84,7 @@ tests		:= test-errno tstgetopt testfnm runtests runptests \
 		   tst-nice tst-nanosleep tst-regex2 \
 		   transbug tst-rxspencer tst-pcre tst-boost \
 		   bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 \
-		   tst-waitid tst-wait4 \
+		   tst-waitid tst-wait4 tst-wait3 \
 		   tst-getaddrinfo2 bug-glob2 bug-glob3 tst-sysconf \
 		   tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
 		   tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
diff --git a/posix/tst-wait-skeleton.c b/posix/tst-wait-skeleton.c
new file mode 100644
index 0000000000..57022cb61c
--- /dev/null
+++ b/posix/tst-wait-skeleton.c
@@ -0,0 +1,209 @@
+/* Test framework for wait3 and wait4.
+   Copyright (C) 2020-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 <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include <signal.h>
+#include <time.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+
+#include <support/xsignal.h>
+#include <support/xunistd.h>
+#include <support/check.h>
+#include <support/process_state.h>
+
+static void
+test_child (void)
+{
+  /* First thing, we stop ourselves.  */
+  raise (SIGSTOP);
+
+  /* Hey, we got continued!  */
+  while (1)
+    pause ();
+}
+
+#ifndef WEXITED
+# define WEXITED        0
+# define WCONTINUED     0
+# define WSTOPPED       WUNTRACED
+#endif
+
+/* Set with only SIGCHLD on do_test_waitid.  */
+static sigset_t chldset;
+
+#ifdef SA_SIGINFO
+static void
+sigchld (int signo, siginfo_t *info, void *ctx)
+{
+}
+#endif
+
+static void
+check_sigchld (int code, int status, pid_t pid)
+{
+#ifdef SA_SIGINFO
+  siginfo_t siginfo;
+  TEST_COMPARE (sigwaitinfo (&chldset, &siginfo), SIGCHLD);
+
+  TEST_COMPARE (siginfo.si_signo, SIGCHLD);
+  TEST_COMPARE (siginfo.si_code, code);
+  TEST_COMPARE (siginfo.si_status, status);
+  TEST_COMPARE (siginfo.si_pid, pid);
+#endif
+}
+
+static int
+do_test_wait (pid_t pid)
+{
+  /* Adding process_state_tracing_stop ('t') allows the test to work under
+     trace programs such as ptrace.  */
+  enum support_process_state stop_state = support_process_state_stopped
+                                          | support_process_state_tracing_stop;
+
+  support_process_state_wait (pid, stop_state);
+
+  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
+
+  pid_t ret;
+  int wstatus;
+  struct rusage rusage;
+
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, NULL);
+  if (ret == -1 && errno == ENOTSUP)
+    FAIL_RET ("waitid WNOHANG on stopped: %m");
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFSTOPPED (wstatus));
+
+  /* Issue again but with struct rusage input.  */
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
+  /* With WNOHANG and WUNTRACED, if the children has not changes its state
+     since previous call the expected result it 0.  */
+  TEST_COMPARE (ret, 0);
+
+  /* Some sanity tests to check if 'wtatus' and 'rusage' possible
+     input values.  */
+  ret = WAIT_CALL (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
+  TEST_COMPARE (ret, 0);
+  ret = WAIT_CALL (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, NULL);
+  TEST_COMPARE (ret, 0);
+
+  if (kill (pid, SIGCONT) != 0)
+    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
+
+  /* Wait for the child to have continued.  */
+  support_process_state_wait (pid, support_process_state_sleeping);
+
+#if WCONTINUED != 0
+  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
+
+  ret = WAIT_CALL (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFCONTINUED (wstatus));
+
+  /* Issue again but with struct rusage input.  */
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
+  /* With WNOHANG and WUNTRACED, if the children has not changes its state
+     since previous call the expected result it 0.  */
+  TEST_COMPARE (ret, 0);
+
+  /* Now stop him again and test waitpid with WCONTINUED.  */
+  if (kill (pid, SIGSTOP) != 0)
+    FAIL_RET ("kill (%d, SIGSTOP): %m\n", pid);
+
+  /* Wait the child stop.  The waitid call below will block until it has
+     stopped, but if we are real quick and enter the waitid system call
+     before the SIGCHLD has been generated, then it will be discarded and
+     never delivered.  */
+  support_process_state_wait (pid, stop_state);
+
+  ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WNOHANG, &rusage);
+  TEST_COMPARE (ret, pid);
+
+  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
+
+  if (kill (pid, SIGCONT) != 0)
+    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
+
+  /* Wait for the child to have continued.  */
+  support_process_state_wait (pid, support_process_state_sleeping);
+
+  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
+
+  ret = WAIT_CALL (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFCONTINUED (wstatus));
+#endif
+
+  /* Die, child, die!  */
+  if (kill (pid, SIGKILL) != 0)
+    FAIL_RET ("kill (%d, SIGKILL): %m\n", pid);
+
+  support_process_state_wait (pid, support_process_state_zombie);
+
+  ret = WAIT_CALL (pid, &wstatus, 0, &rusage);
+  TEST_COMPARE (ret, pid);
+  TEST_VERIFY (WIFSIGNALED (wstatus));
+  TEST_VERIFY (WTERMSIG (wstatus) == SIGKILL);
+
+  check_sigchld (CLD_KILLED, SIGKILL, pid);
+
+  return 0;
+}
+
+static int
+do_test (void)
+{
+#ifdef SA_SIGINFO
+  {
+    struct sigaction sa;
+    sa.sa_flags = SA_SIGINFO | SA_RESTART;
+    sa.sa_sigaction = sigchld;
+    sigemptyset (&sa.sa_mask);
+    xsigaction (SIGCHLD, &sa, NULL);
+  }
+#endif
+
+  sigemptyset (&chldset);
+  sigaddset (&chldset, SIGCHLD);
+
+  /* The SIGCHLD shall has blocked at the time of the call to sigwait;
+     otherwise, the behavior is undefined.  */
+  sigprocmask (SIG_BLOCK, &chldset, NULL);
+
+  pid_t pid = xfork ();
+  if (pid == 0)
+    {
+      test_child ();
+      _exit (127);
+    }
+
+  do_test_wait (pid);
+
+  xsignal (SIGCHLD, SIG_IGN);
+  kill (pid, SIGKILL);          /* Make sure it's dead if we bailed early.  */
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/posix/tst-wait3.c b/posix/tst-wait3.c
new file mode 100644
index 0000000000..27411c04e4
--- /dev/null
+++ b/posix/tst-wait3.c
@@ -0,0 +1,22 @@
+/* Tests for wait3.
+   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/>.  */
+
+#define WAIT_CALL(__pid, __wstatus, __options, __rusage) \
+   wait3 (__wstatus, __options, __rusage)
+
+#include "tst-wait-skeleton.c"
diff --git a/posix/tst-wait4.c b/posix/tst-wait4.c
index e4ce79d2cd..b7532d3891 100644
--- a/posix/tst-wait4.c
+++ b/posix/tst-wait4.c
@@ -16,194 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/resource.h>
-#include <signal.h>
-#include <time.h>
-#include <stdatomic.h>
-#include <stdbool.h>
+#define WAIT_CALL(__pid, __wstatus, __options, __rusage) \
+   wait4 (__pid, __wstatus, __options, __rusage)
 
-#include <support/xsignal.h>
-#include <support/xunistd.h>
-#include <support/check.h>
-#include <support/process_state.h>
-
-static void
-test_child (void)
-{
-  /* First thing, we stop ourselves.  */
-  raise (SIGSTOP);
-
-  /* Hey, we got continued!  */
-  while (1)
-    pause ();
-}
-
-#ifndef WEXITED
-# define WEXITED        0
-# define WCONTINUED     0
-# define WSTOPPED       WUNTRACED
-#endif
-
-/* Set with only SIGCHLD on do_test_waitid.  */
-static sigset_t chldset;
-
-#ifdef SA_SIGINFO
-static void
-sigchld (int signo, siginfo_t *info, void *ctx)
-{
-}
-#endif
-
-static void
-check_sigchld (int code, int status, pid_t pid)
-{
-#ifdef SA_SIGINFO
-  siginfo_t siginfo;
-  TEST_COMPARE (sigwaitinfo (&chldset, &siginfo), SIGCHLD);
-
-  TEST_COMPARE (siginfo.si_signo, SIGCHLD);
-  TEST_COMPARE (siginfo.si_code, code);
-  TEST_COMPARE (siginfo.si_status, status);
-  TEST_COMPARE (siginfo.si_pid, pid);
-#endif
-}
-
-static int
-do_test_wait4 (pid_t pid)
-{
-  /* Adding process_state_tracing_stop ('t') allows the test to work under
-     trace programs such as ptrace.  */
-  enum support_process_state stop_state = support_process_state_stopped
-                                          | support_process_state_tracing_stop;
-
-  support_process_state_wait (pid, stop_state);
-
-  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
-
-  pid_t ret;
-  int wstatus;
-  struct rusage rusage;
-
-  ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, NULL);
-  if (ret == -1 && errno == ENOTSUP)
-    FAIL_RET ("waitid WNOHANG on stopped: %m");
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFSTOPPED (wstatus));
-
-  /* Issue again but with struct rusage input.  */
-  ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
-  /* With WNOHANG and WUNTRACED, if the children has not changes its state
-     since previous call the expected result it 0.  */
-  TEST_COMPARE (ret, 0);
-
-  /* Some sanity tests to check if 'wtatus' and 'rusage' possible
-     input values.  */
-  ret = wait4 (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
-  TEST_COMPARE (ret, 0);
-  ret = wait4 (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, NULL);
-  TEST_COMPARE (ret, 0);
-
-  if (kill (pid, SIGCONT) != 0)
-    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
-
-  /* Wait for the child to have continued.  */
-  support_process_state_wait (pid, support_process_state_sleeping);
-
-#if WCONTINUED != 0
-  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
-
-  ret = wait4 (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFCONTINUED (wstatus));
-
-  /* Issue again but with struct rusage input.  */
-  ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage);
-  /* With WNOHANG and WUNTRACED, if the children has not changes its state
-     since previous call the expected result it 0.  */
-  TEST_COMPARE (ret, 0);
-
-  /* Now stop him again and test waitpid with WCONTINUED.  */
-  if (kill (pid, SIGSTOP) != 0)
-    FAIL_RET ("kill (%d, SIGSTOP): %m\n", pid);
-
-  /* Wait the child stop.  The waitid call below will block until it has
-     stopped, but if we are real quick and enter the waitid system call
-     before the SIGCHLD has been generated, then it will be discarded and
-     never delivered.  */
-  support_process_state_wait (pid, stop_state);
-
-  ret = wait4 (pid, &wstatus, WUNTRACED|WNOHANG, &rusage);
-  TEST_COMPARE (ret, pid);
-
-  check_sigchld (CLD_STOPPED, SIGSTOP, pid);
-
-  if (kill (pid, SIGCONT) != 0)
-    FAIL_RET ("kill (%d, SIGCONT): %m\n", pid);
-
-  /* Wait for the child to have continued.  */
-  support_process_state_wait (pid, support_process_state_sleeping);
-
-  check_sigchld (CLD_CONTINUED, SIGCONT, pid);
-
-  ret = wait4 (pid, &wstatus, WCONTINUED|WNOHANG, NULL);
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFCONTINUED (wstatus));
-#endif
-
-  /* Die, child, die!  */
-  if (kill (pid, SIGKILL) != 0)
-    FAIL_RET ("kill (%d, SIGKILL): %m\n", pid);
-
-  support_process_state_wait (pid, support_process_state_zombie);
-
-  ret = wait4 (pid, &wstatus, 0, &rusage);
-  TEST_COMPARE (ret, pid);
-  TEST_VERIFY (WIFSIGNALED (wstatus));
-  TEST_VERIFY (WTERMSIG (wstatus) == SIGKILL);
-
-  check_sigchld (CLD_KILLED, SIGKILL, pid);
-
-  return 0;
-}
-
-static int
-do_test (void)
-{
-#ifdef SA_SIGINFO
-  {
-    struct sigaction sa;
-    sa.sa_flags = SA_SIGINFO | SA_RESTART;
-    sa.sa_sigaction = sigchld;
-    sigemptyset (&sa.sa_mask);
-    xsigaction (SIGCHLD, &sa, NULL);
-  }
-#endif
-
-  sigemptyset (&chldset);
-  sigaddset (&chldset, SIGCHLD);
-
-  /* The SIGCHLD shall has blocked at the time of the call to sigwait;
-     otherwise, the behavior is undefined.  */
-  sigprocmask (SIG_BLOCK, &chldset, NULL);
-
-  pid_t pid = xfork ();
-  if (pid == 0)
-    {
-      test_child ();
-      _exit (127);
-    }
-
-  do_test_wait4 (pid);
-
-  xsignal (SIGCHLD, SIG_IGN);
-  kill (pid, SIGKILL);          /* Make sure it's dead if we bailed early.  */
-
-  return 0;
-}
-
-#include <support/test-driver.c>
+#include "tst-wait-skeleton.c"
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (10 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 11/15] posix: Add wait3 tests Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-04-15  7:01   ` Siddhesh Poyarekar
  2021-03-23 13:44 ` [PATCH 13/15] linux: mips: Split librt.abilist " Adhemerval Zanella
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

The n32 will require the 64 bit time symbols for y2038 support.
---
 .../mips/mips64/{ => n32}/libpthread.abilist  |   0
 .../linux/mips/mips64/n64/libpthread.abilist  | 214 ++++++++++++++++++
 2 files changed, 214 insertions(+)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
new file mode 100644
index 0000000000..9c35d0da80
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
@@ -0,0 +1,214 @@
+GLIBC_2.0 _IO_flockfile F
+GLIBC_2.0 _IO_ftrylockfile F
+GLIBC_2.0 _IO_funlockfile F
+GLIBC_2.0 __errno_location F
+GLIBC_2.0 __h_errno_location F
+GLIBC_2.0 __lseek F
+GLIBC_2.0 __open F
+GLIBC_2.0 __pthread_getspecific F
+GLIBC_2.0 __pthread_key_create F
+GLIBC_2.0 __pthread_mutex_destroy F
+GLIBC_2.0 __pthread_mutex_init F
+GLIBC_2.0 __pthread_mutex_lock F
+GLIBC_2.0 __pthread_mutex_trylock F
+GLIBC_2.0 __pthread_mutex_unlock F
+GLIBC_2.0 __pthread_mutexattr_destroy F
+GLIBC_2.0 __pthread_mutexattr_init F
+GLIBC_2.0 __pthread_mutexattr_settype F
+GLIBC_2.0 __pthread_once F
+GLIBC_2.0 __pthread_setspecific F
+GLIBC_2.0 __send F
+GLIBC_2.0 __sigaction F
+GLIBC_2.0 _pthread_cleanup_pop F
+GLIBC_2.0 _pthread_cleanup_pop_restore F
+GLIBC_2.0 _pthread_cleanup_push F
+GLIBC_2.0 _pthread_cleanup_push_defer F
+GLIBC_2.0 flockfile F
+GLIBC_2.0 ftrylockfile F
+GLIBC_2.0 funlockfile F
+GLIBC_2.0 longjmp F
+GLIBC_2.0 lseek F
+GLIBC_2.0 open F
+GLIBC_2.0 pthread_atfork F
+GLIBC_2.0 pthread_cancel F
+GLIBC_2.0 pthread_cond_broadcast F
+GLIBC_2.0 pthread_cond_signal F
+GLIBC_2.0 pthread_cond_timedwait F
+GLIBC_2.0 pthread_cond_wait F
+GLIBC_2.0 pthread_create F
+GLIBC_2.0 pthread_detach F
+GLIBC_2.0 pthread_exit F
+GLIBC_2.0 pthread_getspecific F
+GLIBC_2.0 pthread_join F
+GLIBC_2.0 pthread_key_create F
+GLIBC_2.0 pthread_key_delete F
+GLIBC_2.0 pthread_kill F
+GLIBC_2.0 pthread_kill_other_threads_np F
+GLIBC_2.0 pthread_mutex_destroy F
+GLIBC_2.0 pthread_mutex_init F
+GLIBC_2.0 pthread_mutex_lock F
+GLIBC_2.0 pthread_mutex_trylock F
+GLIBC_2.0 pthread_mutex_unlock F
+GLIBC_2.0 pthread_mutexattr_destroy F
+GLIBC_2.0 pthread_mutexattr_getkind_np F
+GLIBC_2.0 pthread_mutexattr_init F
+GLIBC_2.0 pthread_mutexattr_setkind_np F
+GLIBC_2.0 pthread_once F
+GLIBC_2.0 pthread_setcancelstate F
+GLIBC_2.0 pthread_setcanceltype F
+GLIBC_2.0 pthread_setspecific F
+GLIBC_2.0 pthread_testcancel F
+GLIBC_2.0 raise F
+GLIBC_2.0 sem_destroy F
+GLIBC_2.0 sem_getvalue F
+GLIBC_2.0 sem_init F
+GLIBC_2.0 sem_post F
+GLIBC_2.0 sem_trywait F
+GLIBC_2.0 sem_wait F
+GLIBC_2.0 send F
+GLIBC_2.0 sigaction F
+GLIBC_2.0 siglongjmp F
+GLIBC_2.11 pthread_sigqueue F
+GLIBC_2.12 pthread_getname_np F
+GLIBC_2.12 pthread_mutex_consistent F
+GLIBC_2.12 pthread_mutexattr_getrobust F
+GLIBC_2.12 pthread_mutexattr_setrobust F
+GLIBC_2.12 pthread_setname_np F
+GLIBC_2.18 pthread_getattr_default_np F
+GLIBC_2.18 pthread_setattr_default_np F
+GLIBC_2.2 __libc_allocate_rtsig F
+GLIBC_2.2 __libc_current_sigrtmax F
+GLIBC_2.2 __libc_current_sigrtmin F
+GLIBC_2.2 __open64 F
+GLIBC_2.2 __pread64 F
+GLIBC_2.2 __pthread_rwlock_destroy F
+GLIBC_2.2 __pthread_rwlock_init F
+GLIBC_2.2 __pthread_rwlock_rdlock F
+GLIBC_2.2 __pthread_rwlock_tryrdlock F
+GLIBC_2.2 __pthread_rwlock_trywrlock F
+GLIBC_2.2 __pthread_rwlock_unlock F
+GLIBC_2.2 __pthread_rwlock_wrlock F
+GLIBC_2.2 __pwrite64 F
+GLIBC_2.2 __res_state F
+GLIBC_2.2 lseek64 F
+GLIBC_2.2 open64 F
+GLIBC_2.2 pread F
+GLIBC_2.2 pread64 F
+GLIBC_2.2 pthread_attr_getguardsize F
+GLIBC_2.2 pthread_attr_getstack F
+GLIBC_2.2 pthread_attr_getstackaddr F
+GLIBC_2.2 pthread_attr_getstacksize F
+GLIBC_2.2 pthread_attr_setguardsize F
+GLIBC_2.2 pthread_attr_setstack F
+GLIBC_2.2 pthread_attr_setstackaddr F
+GLIBC_2.2 pthread_attr_setstacksize F
+GLIBC_2.2 pthread_barrier_destroy F
+GLIBC_2.2 pthread_barrier_init F
+GLIBC_2.2 pthread_barrier_wait F
+GLIBC_2.2 pthread_barrierattr_destroy F
+GLIBC_2.2 pthread_barrierattr_init F
+GLIBC_2.2 pthread_barrierattr_setpshared F
+GLIBC_2.2 pthread_condattr_getpshared F
+GLIBC_2.2 pthread_condattr_setpshared F
+GLIBC_2.2 pthread_create F
+GLIBC_2.2 pthread_getconcurrency F
+GLIBC_2.2 pthread_getcpuclockid F
+GLIBC_2.2 pthread_mutex_timedlock F
+GLIBC_2.2 pthread_mutexattr_getpshared F
+GLIBC_2.2 pthread_mutexattr_gettype F
+GLIBC_2.2 pthread_mutexattr_setpshared F
+GLIBC_2.2 pthread_mutexattr_settype F
+GLIBC_2.2 pthread_rwlock_destroy F
+GLIBC_2.2 pthread_rwlock_init F
+GLIBC_2.2 pthread_rwlock_rdlock F
+GLIBC_2.2 pthread_rwlock_timedrdlock F
+GLIBC_2.2 pthread_rwlock_timedwrlock F
+GLIBC_2.2 pthread_rwlock_tryrdlock F
+GLIBC_2.2 pthread_rwlock_trywrlock F
+GLIBC_2.2 pthread_rwlock_unlock F
+GLIBC_2.2 pthread_rwlock_wrlock F
+GLIBC_2.2 pthread_rwlockattr_destroy F
+GLIBC_2.2 pthread_rwlockattr_getkind_np F
+GLIBC_2.2 pthread_rwlockattr_getpshared F
+GLIBC_2.2 pthread_rwlockattr_init F
+GLIBC_2.2 pthread_rwlockattr_setkind_np F
+GLIBC_2.2 pthread_rwlockattr_setpshared F
+GLIBC_2.2 pthread_setconcurrency F
+GLIBC_2.2 pthread_spin_destroy F
+GLIBC_2.2 pthread_spin_init F
+GLIBC_2.2 pthread_spin_lock F
+GLIBC_2.2 pthread_spin_trylock F
+GLIBC_2.2 pthread_spin_unlock F
+GLIBC_2.2 pthread_yield F
+GLIBC_2.2 pwrite F
+GLIBC_2.2 pwrite64 F
+GLIBC_2.2 sem_close F
+GLIBC_2.2 sem_destroy F
+GLIBC_2.2 sem_getvalue F
+GLIBC_2.2 sem_init F
+GLIBC_2.2 sem_open F
+GLIBC_2.2 sem_post F
+GLIBC_2.2 sem_timedwait F
+GLIBC_2.2 sem_trywait F
+GLIBC_2.2 sem_unlink F
+GLIBC_2.2 sem_wait F
+GLIBC_2.2.3 __libpthread_version_placeholder F
+GLIBC_2.2.6 __libpthread_version_placeholder F
+GLIBC_2.28 call_once F
+GLIBC_2.28 cnd_broadcast F
+GLIBC_2.28 cnd_destroy F
+GLIBC_2.28 cnd_init F
+GLIBC_2.28 cnd_signal F
+GLIBC_2.28 cnd_timedwait F
+GLIBC_2.28 cnd_wait F
+GLIBC_2.28 mtx_destroy F
+GLIBC_2.28 mtx_init F
+GLIBC_2.28 mtx_lock F
+GLIBC_2.28 mtx_timedlock F
+GLIBC_2.28 mtx_trylock F
+GLIBC_2.28 mtx_unlock F
+GLIBC_2.28 thrd_create F
+GLIBC_2.28 thrd_detach F
+GLIBC_2.28 thrd_exit F
+GLIBC_2.28 thrd_join F
+GLIBC_2.28 tss_create F
+GLIBC_2.28 tss_delete F
+GLIBC_2.28 tss_get F
+GLIBC_2.28 tss_set F
+GLIBC_2.3.2 pthread_cond_broadcast F
+GLIBC_2.3.2 pthread_cond_signal F
+GLIBC_2.3.2 pthread_cond_timedwait F
+GLIBC_2.3.2 pthread_cond_wait F
+GLIBC_2.3.3 __pthread_cleanup_routine F
+GLIBC_2.3.3 __pthread_register_cancel F
+GLIBC_2.3.3 __pthread_register_cancel_defer F
+GLIBC_2.3.3 __pthread_unregister_cancel F
+GLIBC_2.3.3 __pthread_unregister_cancel_restore F
+GLIBC_2.3.3 __pthread_unwind_next F
+GLIBC_2.3.3 pthread_attr_getaffinity_np F
+GLIBC_2.3.3 pthread_attr_setstack F
+GLIBC_2.3.3 pthread_attr_setstacksize F
+GLIBC_2.3.3 pthread_barrierattr_getpshared F
+GLIBC_2.3.3 pthread_condattr_getclock F
+GLIBC_2.3.3 pthread_condattr_setclock F
+GLIBC_2.3.3 pthread_setaffinity_np F
+GLIBC_2.3.3 pthread_timedjoin_np F
+GLIBC_2.3.3 pthread_tryjoin_np F
+GLIBC_2.3.4 pthread_attr_getaffinity_np F
+GLIBC_2.3.4 pthread_setaffinity_np F
+GLIBC_2.3.4 pthread_setschedprio F
+GLIBC_2.30 pthread_cond_clockwait F
+GLIBC_2.30 pthread_mutex_clocklock F
+GLIBC_2.30 pthread_rwlock_clockrdlock F
+GLIBC_2.30 pthread_rwlock_clockwrlock F
+GLIBC_2.30 sem_clockwait F
+GLIBC_2.31 pthread_clockjoin_np F
+GLIBC_2.4 pthread_mutex_consistent_np F
+GLIBC_2.4 pthread_mutex_getprioceiling F
+GLIBC_2.4 pthread_mutex_setprioceiling F
+GLIBC_2.4 pthread_mutexattr_getprioceiling F
+GLIBC_2.4 pthread_mutexattr_getprotocol F
+GLIBC_2.4 pthread_mutexattr_getrobust_np F
+GLIBC_2.4 pthread_mutexattr_setprioceiling F
+GLIBC_2.4 pthread_mutexattr_setprotocol F
+GLIBC_2.4 pthread_mutexattr_setrobust_np F
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 13/15] linux: mips: Split librt.abilist in n32 and n64
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (11 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-03-23 13:44 ` [PATCH 14/15] linux: mips: Split libanl.abilist " Adhemerval Zanella
  2021-03-23 13:44 ` [PATCH 15/15] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella
  14 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

The n32 will require the 64 bit time symbols for y2038 support.
---
 .../linux/mips/mips64/{ => n32}/librt.abilist |  0
 .../sysv/linux/mips/mips64/n64/librt.abilist  | 37 +++++++++++++++++++
 2 files changed, 37 insertions(+)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/librt.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/mips/mips64/librt.abilist
rename to sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
new file mode 100644
index 0000000000..1539c1cef9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist
@@ -0,0 +1,37 @@
+GLIBC_2.2 aio_cancel F
+GLIBC_2.2 aio_cancel64 F
+GLIBC_2.2 aio_error F
+GLIBC_2.2 aio_error64 F
+GLIBC_2.2 aio_fsync F
+GLIBC_2.2 aio_fsync64 F
+GLIBC_2.2 aio_init F
+GLIBC_2.2 aio_read F
+GLIBC_2.2 aio_read64 F
+GLIBC_2.2 aio_return F
+GLIBC_2.2 aio_return64 F
+GLIBC_2.2 aio_suspend F
+GLIBC_2.2 aio_suspend64 F
+GLIBC_2.2 aio_write F
+GLIBC_2.2 aio_write64 F
+GLIBC_2.2 lio_listio F
+GLIBC_2.2 lio_listio64 F
+GLIBC_2.2 shm_open F
+GLIBC_2.2 shm_unlink F
+GLIBC_2.2 timer_create F
+GLIBC_2.2 timer_delete F
+GLIBC_2.2 timer_getoverrun F
+GLIBC_2.2 timer_gettime F
+GLIBC_2.2 timer_settime F
+GLIBC_2.3.4 mq_close F
+GLIBC_2.3.4 mq_getattr F
+GLIBC_2.3.4 mq_notify F
+GLIBC_2.3.4 mq_open F
+GLIBC_2.3.4 mq_receive F
+GLIBC_2.3.4 mq_send F
+GLIBC_2.3.4 mq_setattr F
+GLIBC_2.3.4 mq_timedreceive F
+GLIBC_2.3.4 mq_timedsend F
+GLIBC_2.3.4 mq_unlink F
+GLIBC_2.4 lio_listio F
+GLIBC_2.4 lio_listio64 F
+GLIBC_2.7 __mq_open_2 F
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 14/15] linux: mips: Split libanl.abilist in n32 and n64
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (12 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 13/15] linux: mips: Split librt.abilist " Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  2021-03-23 13:44 ` [PATCH 15/15] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella
  14 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

The n32 will require the 64 bit time symbols for y2038 support.
---
 sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist | 0
 sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist       | 4 ++++
 2 files changed, 4 insertions(+)
 rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist
rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
new file mode 100644
index 0000000000..d9a5ed015d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.2.3 gai_cancel F
+GLIBC_2.2.3 gai_error F
+GLIBC_2.2.3 gai_suspend F
+GLIBC_2.2.3 getaddrinfo_a F
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 15/15] linux: s390: Add libanl.abilist in s390 and s390x
  2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
                   ` (13 preceding siblings ...)
  2021-03-23 13:44 ` [PATCH 14/15] linux: mips: Split libanl.abilist " Adhemerval Zanella
@ 2021-03-23 13:44 ` Adhemerval Zanella
  14 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 13:44 UTC (permalink / raw)
  To: libc-alpha

The s390 will require the 64 bit time symbols for y2038 support.
---
 sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist | 0
 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist       | 4 ++++
 2 files changed, 4 insertions(+)
 rename sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist

diff --git a/sysdeps/unix/sysv/linux/s390/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/s390/libanl.abilist
rename to sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
new file mode 100644
index 0000000000..d9a5ed015d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.2.3 gai_cancel F
+GLIBC_2.2.3 gai_error F
+GLIBC_2.2.3 gai_suspend F
+GLIBC_2.2.3 getaddrinfo_a F
-- 
2.27.0


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh
  2021-03-23 13:44 ` [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella
@ 2021-03-23 14:24   ` Andreas Schwab
  2021-03-23 16:03     ` Adhemerval Zanella
  2021-04-15  5:46   ` Siddhesh Poyarekar
  1 sibling, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2021-03-23 14:24 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

On Mär 23 2021, Adhemerval Zanella via Libc-alpha wrote:

> Instead of creating files on glibc source dir.

The files were never created in the source directory.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/15] time: Add timegm/timelocal basic tests
  2021-03-23 13:44 ` [PATCH 08/15] time: Add timegm/timelocal basic tests Adhemerval Zanella
@ 2021-03-23 14:28   ` Andreas Schwab
  2021-03-23 15:53     ` Adhemerval Zanella
  0 siblings, 1 reply; 34+ messages in thread
From: Andreas Schwab @ 2021-03-23 14:28 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

On Mär 23 2021, Adhemerval Zanella via Libc-alpha wrote:

> +  /* timelocal is a alias to timegm with the only difference it takes local
> +     timezone into account, while timegm takes the input value to be UTC.  */

That doesn't make sense.  How can they be aliases if they differ?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/15] time: Add timegm/timelocal basic tests
  2021-03-23 14:28   ` Andreas Schwab
@ 2021-03-23 15:53     ` Adhemerval Zanella
  2021-04-15  6:05       ` Siddhesh Poyarekar
  0 siblings, 1 reply; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 15:53 UTC (permalink / raw)
  To: Andreas Schwab, Adhemerval Zanella via Libc-alpha



On 23/03/2021 11:28, Andreas Schwab wrote:
> On Mär 23 2021, Adhemerval Zanella via Libc-alpha wrote:
> 
>> +  /* timelocal is a alias to timegm with the only difference it takes local
>> +     timezone into account, while timegm takes the input value to be UTC.  */
> 
> That doesn't make sense.  How can they be aliases if they differ?

Indeed, I got confused there.  A better comment would be:

| /* timelocal is an alias to mktime and behaves like timegm with the
|    difference that it takes timezone into account.  */

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh
  2021-03-23 14:24   ` Andreas Schwab
@ 2021-03-23 16:03     ` Adhemerval Zanella
  0 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2021-03-23 16:03 UTC (permalink / raw)
  To: Andreas Schwab, Adhemerval Zanella via Libc-alpha



On 23/03/2021 11:24, Andreas Schwab wrote:
> On Mär 23 2021, Adhemerval Zanella via Libc-alpha wrote:
> 
>> Instead of creating files on glibc source dir.
> 
> The files were never created in the source directory.

I removed it from commit message.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/15] io: Move file timestamps tests out of Linux
  2021-03-23 13:44 ` [PATCH 01/15] io: Move file timestamps tests out of Linux Adhemerval Zanella
@ 2021-04-15  5:04   ` Siddhesh Poyarekar
  2021-04-15  5:15     ` Siddhesh Poyarekar
  0 siblings, 1 reply; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  5:04 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> Now that libsupport abstract Linux possible missing support (either
> due FS limitation that can't handle 64 bit timestamp or architectures
> that do not handle values larger than unsigned 32 bit values) the
> tests can be turned generic.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.  I also built the
> tests for i686-gnu.

OK.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 02/15] linux: Add futimes test
  2021-03-23 13:44 ` [PATCH 02/15] linux: Add futimes test Adhemerval Zanella
@ 2021-04-15  5:07   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  5:07 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> It uses stat to compare against the values set by futimes.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.

OK.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/15] io: Move file timestamps tests out of Linux
  2021-04-15  5:04   ` Siddhesh Poyarekar
@ 2021-04-15  5:15     ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  5:15 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 4/15/21 10:34 AM, Siddhesh Poyarekar wrote:
> On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
>> Now that libsupport abstract Linux possible missing support (either
>> due FS limitation that can't handle 64 bit timestamp or architectures
>> that do not handle values larger than unsigned 32 bit values) the
>> tests can be turned generic.
>>
>> Checked on x86_64-linux-gnu and i686-linux-gnu.  I also built the
>> tests for i686-gnu.
> 
> OK.
> 
> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
> 

I should mention that I had to fix up the patch before commit because 
sysdeps/unix/sysv/linux/Makefile had changed.  It was a trivial change 
though.

Siddhesh

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 03/15] linux: Add lutimes test
  2021-03-23 13:44 ` [PATCH 03/15] linux: Add lutimes test Adhemerval Zanella
@ 2021-04-15  5:25   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  5:25 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> It uses stat to compare against the values set by lutimes.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.

LGTM.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 04/15] io: Add basic tests for utimensat
  2021-03-23 13:44 ` [PATCH 04/15] io: Add basic tests for utimensat Adhemerval Zanella
@ 2021-04-15  5:33   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  5:33 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> Checked on x86_64-linux-gnu and i686-linux-gnu

LGTM.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh
  2021-03-23 13:44 ` [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella
  2021-03-23 14:24   ` Andreas Schwab
@ 2021-04-15  5:46   ` Siddhesh Poyarekar
  1 sibling, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  5:46 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> Instead of creating files on glibc source dir.  It also allows run
> in parallel.
> 

LGTM with reference to glibc source directory dropped from the commit 
message.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 06/15] time: Add getitimer and setitimer basic tests
  2021-03-23 13:44 ` [PATCH 06/15] time: Add getitimer and setitimer basic tests Adhemerval Zanella
@ 2021-04-15  5:59   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  5:59 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> Checked on i686-linux-gnu and x86_64-linux-gnu.
> ---

LGTM with a small nit fixed below.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>


>   time/Makefile     |   2 +-
>   time/tst-itimer.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 176 insertions(+), 1 deletion(-)
>   create mode 100644 time/tst-itimer.c
> 
> diff --git a/time/Makefile b/time/Makefile
> index 99b5d42666..91cb02a003 100644
> --- a/time/Makefile
> +++ b/time/Makefile
> @@ -49,7 +49,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
>   	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
>   	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
>   	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
> -	   tst-settimeofday
> +	   tst-settimeofday tst-itimer
>   
>   include ../Rules
>   
> diff --git a/time/tst-itimer.c b/time/tst-itimer.c
> new file mode 100644
> index 0000000000..e464d6b092
> --- /dev/null
> +++ b/time/tst-itimer.c
> @@ -0,0 +1,175 @@
> +/* Basic tests for getitimer and setitimer.
> +   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 <array_length.h>
> +#include <errno.h>
> +#include <stdlib.h>
> +#include <sys/time.h>
> +#include <support/check.h>
> +#include <support/xsignal.h>
> +#include <unistd.h>
> +#include <time.h>
> +
> +static sig_atomic_t cnt;
> +
> +static void
> +alrm_handler (int sig)
> +{
> +  if (++cnt > 3)
> +    cnt = 3;
> +}
> +
> +static void
> +intr_sleep (int sec)
> +{
> +  struct timespec ts = { .tv_sec = sec, .tv_nsec = 0 };
> +  while (nanosleep (&ts, &ts) == -1 && errno == EINTR)
> +    ;
> +}
> +
> +static int
> +do_test (void)
> +{
> +  struct itimerval it, it_old;
> +  const int timers[] = { ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF };
> +  for (int i = 0; i < array_length (timers); i++)
> +    {
> +      TEST_COMPARE (getitimer (timers[i], &it), 0);
> +
> +      /* No timer set, all value should be 0.  */
> +      TEST_COMPARE (it.it_interval.tv_sec, 0);
> +      TEST_COMPARE (it.it_interval.tv_usec, 0);
> +      TEST_COMPARE (it.it_value.tv_sec, 0);
> +      TEST_COMPARE (it.it_value.tv_usec, 0);
> +
> +      it.it_interval.tv_sec = 10;
> +      it.it_interval.tv_usec = 20;
> +      TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
> +
> +      TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old),
> +		    0);
> +      /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while

s/single-sort/single-shot/

> +	 other timers returns setitimer value.  */
> +      if (timers[i] == ITIMER_REAL)
> +	{
> +	  TEST_COMPARE (it_old.it_interval.tv_sec, 0);
> +	  TEST_COMPARE (it_old.it_interval.tv_usec, 0);
> +	}
> +      else
> +	{
> +	  TEST_COMPARE (it_old.it_interval.tv_sec, 10);
> +	  TEST_COMPARE (it_old.it_interval.tv_usec, 20);
> +	}
> +
> +      /* Create a periodic timer and check if the return value is the one
> +	 previously set.  */
> +      it.it_interval.tv_sec = 10;
> +      it.it_interval.tv_usec = 20;
> +      it.it_value.tv_sec = 30;
> +      it.it_value.tv_usec = 40;
> +      TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
> +
> +      TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old),
> +		    0);
> +      TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec);
> +      TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec);
> +
> +      if (sizeof (time_t) == 4)
> +	continue;
> +
> +      /* Same as before, but with a 64 bit time_t value.  */
> +      it.it_interval.tv_sec = (time_t) 0x1ffffffffull;
> +      it.it_interval.tv_usec = 20;
> +      it.it_value.tv_sec = 0;
> +      it.it_value.tv_usec = 0;
> +
> +      /* Linux does not provide 64 bit time_t support for getitimer and
> +	 setitimer on architectures with 32 bit time_t support.  */
> +      if (sizeof (__time_t) == 8)
> +	{
> +	  TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
> +	  TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 },
> +				   &it_old),
> +			0);
> +	  /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while other
> +	     timers returns setitimer value.  */
> +	  if (timers[i] == ITIMER_REAL)
> +	    {
> +	      TEST_COMPARE (it_old.it_interval.tv_sec, 0ull);
> +	      TEST_COMPARE (it_old.it_interval.tv_usec, 0);
> +	    }
> +	  else
> +	    {
> +	      TEST_COMPARE (it_old.it_interval.tv_sec, 0x1ffffffffull);
> +	      TEST_COMPARE (it_old.it_interval.tv_usec, 20);
> +	    }
> +	}
> +      else
> +	{
> +	  TEST_COMPARE (setitimer (timers[i], &it, NULL), -1);
> +	  TEST_COMPARE (errno, EOVERFLOW);
> +	}
> +
> +      /* Create a periodic timer and check if the return value is the one
> +	 previously set.  */
> +      it.it_interval.tv_sec = (time_t) 0x1ffffffffull;
> +      it.it_interval.tv_usec = 20;
> +      it.it_value.tv_sec = 30;
> +      it.it_value.tv_usec = 40;
> +      if (sizeof (__time_t) == 8)
> +	{
> +	  TEST_COMPARE (setitimer (timers[i], &it, NULL), 0);
> +
> +	  TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 },
> +				   &it_old),
> +			0);
> +	  TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec);
> +	  TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec);
> +	}
> +      else
> +	{
> +	  TEST_COMPARE (setitimer (timers[i], &it, NULL), -1);
> +	  TEST_COMPARE (errno, EOVERFLOW);
> +	}
> +  }
> +
> +  {
> +    struct sigaction sa = { .sa_handler = alrm_handler, .sa_flags = 0 };
> +    sigemptyset (&sa.sa_mask);
> +    xsigaction (SIGALRM, &sa, NULL);
> +  }
> +
> +  /* Setup a timer to 0.1s and sleep for 1s and check to 3 signal handler
> +     execution.  */
> +  it.it_interval.tv_sec = 0;
> +  it.it_interval.tv_usec = 100000;
> +  it.it_value.tv_sec = 0;
> +  it.it_value.tv_usec = 100000;
> +
> +  /* Check ITIMER_VIRTUAL and ITIMER_PROF would require to generate load
> +     and be subject to system load.  */
> +  cnt = 0;
> +  TEST_COMPARE (setitimer (ITIMER_REAL, &it, NULL), 0);
> +  intr_sleep (1);
> +  TEST_COMPARE (cnt, 3);
> +  TEST_COMPARE (setitimer (ITIMER_REAL, &(struct itimerval) { 0 }, NULL), 0);
> +
> +  return 0;
> +}
> +
> +#include <support/test-driver.c>
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 07/15] time: Add gmtime/gmtime_r tests
  2021-03-23 13:44 ` [PATCH 07/15] time: Add gmtime/gmtime_r tests Adhemerval Zanella
@ 2021-04-15  6:01   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  6:01 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> Checked on x86_64-linux-gnu and i686-linux-gnu.
> ---

LGTM with a small nit fixed below.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>


>   time/Makefile     |   2 +-
>   time/tst-gmtime.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 126 insertions(+), 1 deletion(-)
>   create mode 100644 time/tst-gmtime.c
> 
> diff --git a/time/Makefile b/time/Makefile
> index 91cb02a003..a503297527 100644
> --- a/time/Makefile
> +++ b/time/Makefile
> @@ -49,7 +49,7 @@ tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
>   	   tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
>   	   tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \
>   	   tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-clock_settime \
> -	   tst-settimeofday tst-itimer
> +	   tst-settimeofday tst-itimer tst-gmtime
>   
>   include ../Rules
>   
> diff --git a/time/tst-gmtime.c b/time/tst-gmtime.c
> new file mode 100644
> index 0000000000..4d09cade79
> --- /dev/null
> +++ b/time/tst-gmtime.c
> @@ -0,0 +1,125 @@
> +/* Basic tests for gmtime.
> +   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 <time.h>
> +#include <stdlib.h>
> +#include <support/check.h>
> +
> +static int
> +do_test (void)
> +{
> +  /* Check if the epoch time can be converted.  */
> +  {
> +    time_t t = 0;
> +    struct tm *tmg = gmtime (&t);
> +    TEST_COMPARE (tmg->tm_sec,   0);
> +    TEST_COMPARE (tmg->tm_min,   0);
> +    TEST_COMPARE (tmg->tm_hour,  0);
> +    TEST_COMPARE (tmg->tm_mday,  1);
> +    TEST_COMPARE (tmg->tm_mon,   0);
> +    TEST_COMPARE (tmg->tm_year,  70);
> +    TEST_COMPARE (tmg->tm_wday,  4);
> +    TEST_COMPARE (tmg->tm_yday,  0);
> +    TEST_COMPARE (tmg->tm_isdst, 0);
> +  }
> +  {
> +    /* Same as before but with gmtime_r.  */
> +    time_t t = 0;
> +    struct tm tms;
> +    struct tm *tmg = gmtime_r (&t, &tms);
> +    TEST_VERIFY (tmg == &tms);
> +    TEST_COMPARE (tmg->tm_year, 70);

Duplicated check?

> +    TEST_COMPARE (tmg->tm_sec,   0);
> +    TEST_COMPARE (tmg->tm_min,   0);
> +    TEST_COMPARE (tmg->tm_hour,  0);
> +    TEST_COMPARE (tmg->tm_mday,  1);
> +    TEST_COMPARE (tmg->tm_mon,   0);
> +    TEST_COMPARE (tmg->tm_year,  70);
> +    TEST_COMPARE (tmg->tm_wday,  4);
> +    TEST_COMPARE (tmg->tm_yday,  0);
> +    TEST_COMPARE (tmg->tm_isdst, 0);
> +  }
> +
> +  /* Check if the max time value for 32 bit time_t can be converted.  */
> +  {
> +    time_t t = 0x7fffffff;
> +    struct tm *tmg = gmtime (&t);
> +    TEST_COMPARE (tmg->tm_sec,   7);
> +    TEST_COMPARE (tmg->tm_min,   14);
> +    TEST_COMPARE (tmg->tm_hour,  3);
> +    TEST_COMPARE (tmg->tm_mday,  19);
> +    TEST_COMPARE (tmg->tm_mon,   0);
> +    TEST_COMPARE (tmg->tm_year,  138);
> +    TEST_COMPARE (tmg->tm_wday,  2);
> +    TEST_COMPARE (tmg->tm_yday,  18);
> +    TEST_COMPARE (tmg->tm_isdst, 0);
> +  }
> +  {
> +    /* Same as before but with ctime_r.  */
> +    time_t t = 0x7fffffff;
> +    struct tm tms;
> +    struct tm *tmg = gmtime_r (&t, &tms);
> +    TEST_VERIFY (tmg == &tms);
> +    TEST_COMPARE (tmg->tm_sec,   7);
> +    TEST_COMPARE (tmg->tm_min,   14);
> +    TEST_COMPARE (tmg->tm_hour,  3);
> +    TEST_COMPARE (tmg->tm_mday,  19);
> +    TEST_COMPARE (tmg->tm_mon,   0);
> +    TEST_COMPARE (tmg->tm_year,  138);
> +    TEST_COMPARE (tmg->tm_wday,  2);
> +    TEST_COMPARE (tmg->tm_yday,  18);
> +    TEST_COMPARE (tmg->tm_isdst, 0);
> +  }
> +
> +  if (sizeof (time_t) < 8)
> +    return 0;
> +
> +  {
> +    time_t t = (time_t) 0x80000000ull;
> +    struct tm *tmg = gmtime (&t);
> +    TEST_COMPARE (tmg->tm_sec,   8);
> +    TEST_COMPARE (tmg->tm_min,   14);
> +    TEST_COMPARE (tmg->tm_hour,  3);
> +    TEST_COMPARE (tmg->tm_mday,  19);
> +    TEST_COMPARE (tmg->tm_mon,   0);
> +    TEST_COMPARE (tmg->tm_year,  138);
> +    TEST_COMPARE (tmg->tm_wday,  2);
> +    TEST_COMPARE (tmg->tm_yday,  18);
> +    TEST_COMPARE (tmg->tm_isdst, 0);
> +  }
> +
> +  {
> +    time_t t = (time_t) 0x80000000ull;
> +    struct tm tms;
> +    struct tm *tmg = gmtime_r (&t, &tms);
> +    TEST_VERIFY (tmg == &tms);
> +    TEST_COMPARE (tmg->tm_sec,   8);
> +    TEST_COMPARE (tmg->tm_min,   14);
> +    TEST_COMPARE (tmg->tm_hour,  3);
> +    TEST_COMPARE (tmg->tm_mday,  19);
> +    TEST_COMPARE (tmg->tm_mon,   0);
> +    TEST_COMPARE (tmg->tm_year,  138);
> +    TEST_COMPARE (tmg->tm_wday,  2);
> +    TEST_COMPARE (tmg->tm_yday,  18);
> +    TEST_COMPARE (tmg->tm_isdst, 0);
> +  }
> +
> +  return 0;
> +}
> +
> +#include <support/test-driver.c>
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 08/15] time: Add timegm/timelocal basic tests
  2021-03-23 15:53     ` Adhemerval Zanella
@ 2021-04-15  6:05       ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  6:05 UTC (permalink / raw)
  To: Adhemerval Zanella, Andreas Schwab, Adhemerval Zanella via Libc-alpha

On 3/23/21 9:23 PM, Adhemerval Zanella via Libc-alpha wrote:
> 
> 
> On 23/03/2021 11:28, Andreas Schwab wrote:
>> On Mär 23 2021, Adhemerval Zanella via Libc-alpha wrote:
>>
>>> +  /* timelocal is a alias to timegm with the only difference it 
>>> takes local
>>> +     timezone into account, while timegm takes the input value to be 
>>> UTC.  */
>>
>> That doesn't make sense.  How can they be aliases if they differ?
> 
> Indeed, I got confused there.  A better comment would be:
> 
> | /* timelocal is an alias to mktime and behaves like timegm with the
> |    difference that it takes timezone into account.  */
> 

LGTM with this comment change.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 09/15] time: Add basic timespec_get tests
  2021-03-23 13:44 ` [PATCH 09/15] time: Add basic timespec_get tests Adhemerval Zanella
@ 2021-04-15  6:08   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  6:08 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> Checkec on x86_64-linux-gnu and i686-linux-gnu.
> ---

LGTM.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 10/15] time: Add 64 bit tests for getdate / getdate_r
  2021-03-23 13:44 ` [PATCH 10/15] time: Add 64 bit tests for getdate / getdate_r Adhemerval Zanella
@ 2021-04-15  6:16   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  6:16 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> The test is also converted to use libsupport.
> 
> Checked on i686-linux-gnu and x86_64-linux-gnu.
> ---

LGTM.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 11/15] posix: Add wait3 tests
  2021-03-23 13:44 ` [PATCH 11/15] posix: Add wait3 tests Adhemerval Zanella
@ 2021-04-15  6:26   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  6:26 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> The tst-wait4 is moved to common file and used for wait3
> tests.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.

LGTM.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64
  2021-03-23 13:44 ` [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
@ 2021-04-15  7:01   ` Siddhesh Poyarekar
  2021-04-15 12:00     ` Adhemerval Zanella
  0 siblings, 1 reply; 34+ messages in thread
From: Siddhesh Poyarekar @ 2021-04-15  7:01 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
> The n32 will require the 64 bit time symbols for y2038 support.
> ---

A few symbols are missing in n32 and are there in n64.  Is that 
intentional?  I'd like to defer review for 12-15 to someone who can test 
this out.

Siddhesh

>   .../mips/mips64/{ => n32}/libpthread.abilist  |   0
>   .../linux/mips/mips64/n64/libpthread.abilist  | 214 ++++++++++++++++++
>   2 files changed, 214 insertions(+)
>   rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%)
>   create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> 
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> new file mode 100644
> index 0000000000..9c35d0da80
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist
> @@ -0,0 +1,214 @@
> +GLIBC_2.0 _IO_flockfile F
> +GLIBC_2.0 _IO_ftrylockfile F
> +GLIBC_2.0 _IO_funlockfile F
> +GLIBC_2.0 __errno_location F
> +GLIBC_2.0 __h_errno_location F
> +GLIBC_2.0 __lseek F
> +GLIBC_2.0 __open F
> +GLIBC_2.0 __pthread_getspecific F
> +GLIBC_2.0 __pthread_key_create F
> +GLIBC_2.0 __pthread_mutex_destroy F
> +GLIBC_2.0 __pthread_mutex_init F
> +GLIBC_2.0 __pthread_mutex_lock F
> +GLIBC_2.0 __pthread_mutex_trylock F
> +GLIBC_2.0 __pthread_mutex_unlock F
> +GLIBC_2.0 __pthread_mutexattr_destroy F
> +GLIBC_2.0 __pthread_mutexattr_init F
> +GLIBC_2.0 __pthread_mutexattr_settype F
> +GLIBC_2.0 __pthread_once F
> +GLIBC_2.0 __pthread_setspecific F
> +GLIBC_2.0 __send F
> +GLIBC_2.0 __sigaction F
> +GLIBC_2.0 _pthread_cleanup_pop F
> +GLIBC_2.0 _pthread_cleanup_pop_restore F
> +GLIBC_2.0 _pthread_cleanup_push F
> +GLIBC_2.0 _pthread_cleanup_push_defer F
> +GLIBC_2.0 flockfile F
> +GLIBC_2.0 ftrylockfile F
> +GLIBC_2.0 funlockfile F
> +GLIBC_2.0 longjmp F
> +GLIBC_2.0 lseek F
> +GLIBC_2.0 open F
> +GLIBC_2.0 pthread_atfork F
> +GLIBC_2.0 pthread_cancel F
> +GLIBC_2.0 pthread_cond_broadcast F
> +GLIBC_2.0 pthread_cond_signal F
> +GLIBC_2.0 pthread_cond_timedwait F
> +GLIBC_2.0 pthread_cond_wait F
> +GLIBC_2.0 pthread_create F
> +GLIBC_2.0 pthread_detach F
> +GLIBC_2.0 pthread_exit F
> +GLIBC_2.0 pthread_getspecific F
> +GLIBC_2.0 pthread_join F
> +GLIBC_2.0 pthread_key_create F
> +GLIBC_2.0 pthread_key_delete F
> +GLIBC_2.0 pthread_kill F
> +GLIBC_2.0 pthread_kill_other_threads_np F
> +GLIBC_2.0 pthread_mutex_destroy F
> +GLIBC_2.0 pthread_mutex_init F
> +GLIBC_2.0 pthread_mutex_lock F
> +GLIBC_2.0 pthread_mutex_trylock F
> +GLIBC_2.0 pthread_mutex_unlock F
> +GLIBC_2.0 pthread_mutexattr_destroy F
> +GLIBC_2.0 pthread_mutexattr_getkind_np F
> +GLIBC_2.0 pthread_mutexattr_init F
> +GLIBC_2.0 pthread_mutexattr_setkind_np F
> +GLIBC_2.0 pthread_once F
> +GLIBC_2.0 pthread_setcancelstate F
> +GLIBC_2.0 pthread_setcanceltype F
> +GLIBC_2.0 pthread_setspecific F
> +GLIBC_2.0 pthread_testcancel F
> +GLIBC_2.0 raise F
> +GLIBC_2.0 sem_destroy F
> +GLIBC_2.0 sem_getvalue F
> +GLIBC_2.0 sem_init F
> +GLIBC_2.0 sem_post F
> +GLIBC_2.0 sem_trywait F
> +GLIBC_2.0 sem_wait F
> +GLIBC_2.0 send F
> +GLIBC_2.0 sigaction F
> +GLIBC_2.0 siglongjmp F
> +GLIBC_2.11 pthread_sigqueue F
> +GLIBC_2.12 pthread_getname_np F
> +GLIBC_2.12 pthread_mutex_consistent F
> +GLIBC_2.12 pthread_mutexattr_getrobust F
> +GLIBC_2.12 pthread_mutexattr_setrobust F
> +GLIBC_2.12 pthread_setname_np F
> +GLIBC_2.18 pthread_getattr_default_np F
> +GLIBC_2.18 pthread_setattr_default_np F
> +GLIBC_2.2 __libc_allocate_rtsig F
> +GLIBC_2.2 __libc_current_sigrtmax F
> +GLIBC_2.2 __libc_current_sigrtmin F
> +GLIBC_2.2 __open64 F
> +GLIBC_2.2 __pread64 F
> +GLIBC_2.2 __pthread_rwlock_destroy F
> +GLIBC_2.2 __pthread_rwlock_init F
> +GLIBC_2.2 __pthread_rwlock_rdlock F
> +GLIBC_2.2 __pthread_rwlock_tryrdlock F
> +GLIBC_2.2 __pthread_rwlock_trywrlock F
> +GLIBC_2.2 __pthread_rwlock_unlock F
> +GLIBC_2.2 __pthread_rwlock_wrlock F
> +GLIBC_2.2 __pwrite64 F
> +GLIBC_2.2 __res_state F
> +GLIBC_2.2 lseek64 F
> +GLIBC_2.2 open64 F
> +GLIBC_2.2 pread F
> +GLIBC_2.2 pread64 F
> +GLIBC_2.2 pthread_attr_getguardsize F
> +GLIBC_2.2 pthread_attr_getstack F
> +GLIBC_2.2 pthread_attr_getstackaddr F
> +GLIBC_2.2 pthread_attr_getstacksize F
> +GLIBC_2.2 pthread_attr_setguardsize F
> +GLIBC_2.2 pthread_attr_setstack F
> +GLIBC_2.2 pthread_attr_setstackaddr F
> +GLIBC_2.2 pthread_attr_setstacksize F
> +GLIBC_2.2 pthread_barrier_destroy F
> +GLIBC_2.2 pthread_barrier_init F
> +GLIBC_2.2 pthread_barrier_wait F
> +GLIBC_2.2 pthread_barrierattr_destroy F
> +GLIBC_2.2 pthread_barrierattr_init F
> +GLIBC_2.2 pthread_barrierattr_setpshared F
> +GLIBC_2.2 pthread_condattr_getpshared F
> +GLIBC_2.2 pthread_condattr_setpshared F
> +GLIBC_2.2 pthread_create F
> +GLIBC_2.2 pthread_getconcurrency F
> +GLIBC_2.2 pthread_getcpuclockid F
> +GLIBC_2.2 pthread_mutex_timedlock F
> +GLIBC_2.2 pthread_mutexattr_getpshared F
> +GLIBC_2.2 pthread_mutexattr_gettype F
> +GLIBC_2.2 pthread_mutexattr_setpshared F
> +GLIBC_2.2 pthread_mutexattr_settype F
> +GLIBC_2.2 pthread_rwlock_destroy F
> +GLIBC_2.2 pthread_rwlock_init F
> +GLIBC_2.2 pthread_rwlock_rdlock F
> +GLIBC_2.2 pthread_rwlock_timedrdlock F
> +GLIBC_2.2 pthread_rwlock_timedwrlock F
> +GLIBC_2.2 pthread_rwlock_tryrdlock F
> +GLIBC_2.2 pthread_rwlock_trywrlock F
> +GLIBC_2.2 pthread_rwlock_unlock F
> +GLIBC_2.2 pthread_rwlock_wrlock F
> +GLIBC_2.2 pthread_rwlockattr_destroy F
> +GLIBC_2.2 pthread_rwlockattr_getkind_np F
> +GLIBC_2.2 pthread_rwlockattr_getpshared F
> +GLIBC_2.2 pthread_rwlockattr_init F
> +GLIBC_2.2 pthread_rwlockattr_setkind_np F
> +GLIBC_2.2 pthread_rwlockattr_setpshared F
> +GLIBC_2.2 pthread_setconcurrency F
> +GLIBC_2.2 pthread_spin_destroy F
> +GLIBC_2.2 pthread_spin_init F
> +GLIBC_2.2 pthread_spin_lock F
> +GLIBC_2.2 pthread_spin_trylock F
> +GLIBC_2.2 pthread_spin_unlock F
> +GLIBC_2.2 pthread_yield F
> +GLIBC_2.2 pwrite F
> +GLIBC_2.2 pwrite64 F
> +GLIBC_2.2 sem_close F
> +GLIBC_2.2 sem_destroy F
> +GLIBC_2.2 sem_getvalue F
> +GLIBC_2.2 sem_init F
> +GLIBC_2.2 sem_open F
> +GLIBC_2.2 sem_post F
> +GLIBC_2.2 sem_timedwait F
> +GLIBC_2.2 sem_trywait F
> +GLIBC_2.2 sem_unlink F
> +GLIBC_2.2 sem_wait F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
> +GLIBC_2.2.6 __libpthread_version_placeholder F
> +GLIBC_2.28 call_once F
> +GLIBC_2.28 cnd_broadcast F
> +GLIBC_2.28 cnd_destroy F
> +GLIBC_2.28 cnd_init F
> +GLIBC_2.28 cnd_signal F
> +GLIBC_2.28 cnd_timedwait F
> +GLIBC_2.28 cnd_wait F
> +GLIBC_2.28 mtx_destroy F
> +GLIBC_2.28 mtx_init F
> +GLIBC_2.28 mtx_lock F
> +GLIBC_2.28 mtx_timedlock F
> +GLIBC_2.28 mtx_trylock F
> +GLIBC_2.28 mtx_unlock F
> +GLIBC_2.28 thrd_create F
> +GLIBC_2.28 thrd_detach F
> +GLIBC_2.28 thrd_exit F
> +GLIBC_2.28 thrd_join F
> +GLIBC_2.28 tss_create F
> +GLIBC_2.28 tss_delete F
> +GLIBC_2.28 tss_get F
> +GLIBC_2.28 tss_set F
> +GLIBC_2.3.2 pthread_cond_broadcast F
> +GLIBC_2.3.2 pthread_cond_signal F
> +GLIBC_2.3.2 pthread_cond_timedwait F
> +GLIBC_2.3.2 pthread_cond_wait F
> +GLIBC_2.3.3 __pthread_cleanup_routine F
> +GLIBC_2.3.3 __pthread_register_cancel F
> +GLIBC_2.3.3 __pthread_register_cancel_defer F
> +GLIBC_2.3.3 __pthread_unregister_cancel F
> +GLIBC_2.3.3 __pthread_unregister_cancel_restore F
> +GLIBC_2.3.3 __pthread_unwind_next F
> +GLIBC_2.3.3 pthread_attr_getaffinity_np F
> +GLIBC_2.3.3 pthread_attr_setstack F
> +GLIBC_2.3.3 pthread_attr_setstacksize F
> +GLIBC_2.3.3 pthread_barrierattr_getpshared F
> +GLIBC_2.3.3 pthread_condattr_getclock F
> +GLIBC_2.3.3 pthread_condattr_setclock F
> +GLIBC_2.3.3 pthread_setaffinity_np F
> +GLIBC_2.3.3 pthread_timedjoin_np F
> +GLIBC_2.3.3 pthread_tryjoin_np F
> +GLIBC_2.3.4 pthread_attr_getaffinity_np F
> +GLIBC_2.3.4 pthread_setaffinity_np F
> +GLIBC_2.3.4 pthread_setschedprio F
> +GLIBC_2.30 pthread_cond_clockwait F
> +GLIBC_2.30 pthread_mutex_clocklock F
> +GLIBC_2.30 pthread_rwlock_clockrdlock F
> +GLIBC_2.30 pthread_rwlock_clockwrlock F
> +GLIBC_2.30 sem_clockwait F
> +GLIBC_2.31 pthread_clockjoin_np F
> +GLIBC_2.4 pthread_mutex_consistent_np F
> +GLIBC_2.4 pthread_mutex_getprioceiling F
> +GLIBC_2.4 pthread_mutex_setprioceiling F
> +GLIBC_2.4 pthread_mutexattr_getprioceiling F
> +GLIBC_2.4 pthread_mutexattr_getprotocol F
> +GLIBC_2.4 pthread_mutexattr_getrobust_np F
> +GLIBC_2.4 pthread_mutexattr_setprioceiling F
> +GLIBC_2.4 pthread_mutexattr_setprotocol F
> +GLIBC_2.4 pthread_mutexattr_setrobust_np F
> 


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64
  2021-04-15  7:01   ` Siddhesh Poyarekar
@ 2021-04-15 12:00     ` Adhemerval Zanella
  0 siblings, 0 replies; 34+ messages in thread
From: Adhemerval Zanella @ 2021-04-15 12:00 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha



On 15/04/2021 04:01, Siddhesh Poyarekar wrote:
> On 3/23/21 7:14 PM, Adhemerval Zanella via Libc-alpha wrote:
>> The n32 will require the 64 bit time symbols for y2038 support.
>> ---
> 
> A few symbols are missing in n32 and are there in n64.  Is that intentional?  I'd like to defer review for 12-15 to someone who can test this out.

The symbol difference is because I pushed some patched for the libpthread 
removal project that removed some libpthread.abilist entries.  But this
patch is quite mechanical and it easily verified with a check-abi, so
the rebase should be simple:

$ cp sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist
$ cp sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist

And run a check-abi for mips64-linux-gnu and mips64-n32-linux-gnu.

Same for patches 12-15, the tests should be to just simple ran
make check-abi against the affected ABIs.

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2021-04-15 12:00 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 13:44 [PATCH 00/15] Add some tests and infra changes Adhemerval Zanella
2021-03-23 13:44 ` [PATCH 01/15] io: Move file timestamps tests out of Linux Adhemerval Zanella
2021-04-15  5:04   ` Siddhesh Poyarekar
2021-04-15  5:15     ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 02/15] linux: Add futimes test Adhemerval Zanella
2021-04-15  5:07   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 03/15] linux: Add lutimes test Adhemerval Zanella
2021-04-15  5:25   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 04/15] io: Add basic tests for utimensat Adhemerval Zanella
2021-04-15  5:33   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh Adhemerval Zanella
2021-03-23 14:24   ` Andreas Schwab
2021-03-23 16:03     ` Adhemerval Zanella
2021-04-15  5:46   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 06/15] time: Add getitimer and setitimer basic tests Adhemerval Zanella
2021-04-15  5:59   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 07/15] time: Add gmtime/gmtime_r tests Adhemerval Zanella
2021-04-15  6:01   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 08/15] time: Add timegm/timelocal basic tests Adhemerval Zanella
2021-03-23 14:28   ` Andreas Schwab
2021-03-23 15:53     ` Adhemerval Zanella
2021-04-15  6:05       ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 09/15] time: Add basic timespec_get tests Adhemerval Zanella
2021-04-15  6:08   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 10/15] time: Add 64 bit tests for getdate / getdate_r Adhemerval Zanella
2021-04-15  6:16   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 11/15] posix: Add wait3 tests Adhemerval Zanella
2021-04-15  6:26   ` Siddhesh Poyarekar
2021-03-23 13:44 ` [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64 Adhemerval Zanella
2021-04-15  7:01   ` Siddhesh Poyarekar
2021-04-15 12:00     ` Adhemerval Zanella
2021-03-23 13:44 ` [PATCH 13/15] linux: mips: Split librt.abilist " Adhemerval Zanella
2021-03-23 13:44 ` [PATCH 14/15] linux: mips: Split libanl.abilist " Adhemerval Zanella
2021-03-23 13:44 ` [PATCH 15/15] linux: s390: Add libanl.abilist in s390 and s390x Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).