public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] alarm02: fix for 32-bit kernels
@ 2018-09-11 11:21 Jan Stancek
  2018-09-11 12:00 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2018-09-11 11:21 UTC (permalink / raw)
  To: ltp

Test fails on 32-bit kernels with:
  alarm02.c:55: FAIL: alarm(4294967295) returned 2147483647 as unexpected

because kernel alarm_setitimer() limits seconds to INT_MAX to avoid
negative timeval settings which would cause immediate expiry:

  static unsigned int alarm_setitimer(unsigned int seconds)
  {
        struct itimerval it_new, it_old;

  #if BITS_PER_LONG < 64
        if (seconds > INT_MAX)
                seconds = INT_MAX;
  #endif

Don't test UINT_MAX.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/alarm/alarm02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/alarm/alarm02.c b/testcases/kernel/syscalls/alarm/alarm02.c
index d318c8b14637..94239060c4ef 100644
--- a/testcases/kernel/syscalls/alarm/alarm02.c
+++ b/testcases/kernel/syscalls/alarm/alarm02.c
@@ -21,7 +21,7 @@ static struct tcase {
 	char *str;
 	unsigned int sec;
 } tcases[] = {
-	{"UINT_MAX", UINT_MAX},
+	{"INT_MAX", INT_MAX},
 	{"UINT_MAX/2", UINT_MAX/2},
 	{"UINT_MAX/4", UINT_MAX/4},
 };
-- 
1.8.3.1


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

end of thread, other threads:[~2018-09-11 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11 11:21 [LTP] [PATCH] alarm02: fix for 32-bit kernels Jan Stancek
2018-09-11 12:00 ` Cyril Hrubis
2018-09-11 13:59   ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox