public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] time: Skip overflow itimer tests on 32-bit systems
@ 2021-06-07 13:18 Stafford Horne
  2021-06-09 13:50 ` Adhemerval Zanella
  0 siblings, 1 reply; 8+ messages in thread
From: Stafford Horne @ 2021-06-07 13:18 UTC (permalink / raw)
  To: GLIBC patches; +Cc: Stafford Horne, Adhemerval Zanella, Alistair Francis

On the port of OpenRISC I am working on and it appears the rv32 port
we have sets __TIMESIZE == 64 && __WORDSIZE == 32.  This causes the
size of time_t to be 8 bytes, but the tv_sec in the kernel is still 32-bit
causing truncation.

The truncations are unavoidable on these systems so skip the
testing/failures by guarding with __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64.
---

I am open to other suggestions, this seemed the most correct to me.

Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Alistair Francis <alistair.francis@wdc.com>

 time/tst-itimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/time/tst-itimer.c b/time/tst-itimer.c
index 929c2b74c7..0c99d46d7e 100644
--- a/time/tst-itimer.c
+++ b/time/tst-itimer.c
@@ -89,6 +89,7 @@ do_test (void)
       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 __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
       if (sizeof (time_t) == 4)
 	continue;
 
@@ -146,6 +147,7 @@ do_test (void)
 	  TEST_COMPARE (setitimer (timers[i], &it, NULL), -1);
 	  TEST_COMPARE (errno, EOVERFLOW);
 	}
+#endif
   }
 
   {
-- 
2.31.1


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

end of thread, other threads:[~2022-10-31 14:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 13:18 [PATCH] time: Skip overflow itimer tests on 32-bit systems Stafford Horne
2021-06-09 13:50 ` Adhemerval Zanella
2021-06-09 21:38   ` Stafford Horne
2021-06-12  9:19     ` Stafford Horne
2021-07-06 19:58       ` Adhemerval Zanella
2021-07-07 21:11         ` Stafford Horne
2022-10-28 19:47         ` Aurelien Jarno
2022-10-31 14:02           ` Adhemerval Zanella Netto

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).