Skip to contentSkip to conversation

clock_settime03: change to use CLOCK_REALTIME

PATCH New Li Wang 4 participants 4 messages Aug 19, 2020

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH v2 1/1 clock_settime03: change to use CLOCK_REALTIME

CLOCK_REALTIME_ALARM requires an RTC with alarm support, which may not be present on a system. In that case, the kernel will return EOPNOTSUPP, which is defined as ENOTSUP in userspace.

Here use CLOCK_REALTIME instead of the CLOCK_REALTIME_ALARM because we do NOT need suspend the SUT during test.

For issue #712:
https://github.com/linux-test-project/ltp/issues/712

Cc Viresh Kumar<[email protected]>
Cc Cyril Hrubis <[email protected]>
Cc Jan Stancek <[email protected]>
---
 testcases/kernel/syscalls/clock_settime/clock_settime03.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/clock_settime/clock_settime03.c +1 -1
index 5b75afbe7..ad6183e4c 100644
@@ -65,7 +65,7 @@ static void run(void)
 	SAFE_SIGADDSET(&set, SIGABRT);
 	SAFE_SIGPROCMASK(SIG_BLOCK, &set, NULL);
 
-	TEST(tst_syscall(__NR_timer_create, CLOCK_REALTIME_ALARM, &ev, &timer));
+	TEST(tst_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
 	if (TST_RET != 0)
 		tst_brk(TBROK | TERRNO, "timer_create() failed");
 
Signature · 1 line
2.21.1
#2 lore raw

PATCH v2 1/1 clock_settime03: change to use CLOCK_REALTIME

In reply to Li Wang
Quoted 10 lines · Li Wang

CLOCK_REALTIME_ALARM requires an RTC with alarm support, which may not be present on a system. In that case, the kernel will return EOPNOTSUPP, which is defined as ENOTSUP in userspace.

Here use CLOCK_REALTIME instead of the CLOCK_REALTIME_ALARM because we do NOT need suspend the SUT during test.

For issue #712:
https://github.com/linux-test-project/ltp/issues/712

Quoted 8 lines
Cc Viresh Kumar<[email protected]>
Cc Cyril Hrubis <[email protected]>
Cc Jan Stancek <[email protected]>
---
 testcases/kernel/syscalls/clock_settime/clock_settime03.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
viresh
#3 lore raw

PATCH v2 1/1 clock_settime03: change to use CLOCK_REALTIME

In reply to Li Wang

----- Original Message -----

Quoted 7 lines

CLOCK_REALTIME_ALARM requires an RTC with alarm support, which may not be present on a system. In that case, the kernel will return EOPNOTSUPP, which is defined as ENOTSUP in userspace.

Here use CLOCK_REALTIME instead of the CLOCK_REALTIME_ALARM because we do NOT need suspend the SUT during test.

Quoted 8 lines

For issue #712:
https://github.com/linux-test-project/ltp/issues/712

Cc Viresh Kumar<[email protected]>
Cc Cyril Hrubis <[email protected]>
Cc Jan Stancek <[email protected]>