cobalt/posix/clock: Allow NULL resolution on clock_getres64
PATCH v2 1/1 cobalt/posix/clock: Allow NULL resolution on clock_getres64
From: Jan Kiszka <[email protected]>
Permitted according to POSIX spec. Adjust the testsuite accordingly.
---
Changes in v2:
- also adjust the test case
kernel/cobalt/posix/clock.c | 2 +- testsuite/smokey/y2038/syscall-tests.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
kernel/cobalt/posix/clock.c +1 -1
@@ -103,7 +103,7 @@ COBALT_SYSCALL(clock_getres64, current,if (ret)return ret; -if (cobalt_put_timespec64 (&ts, u_ts)) +if (u_ts &&cobalt_put_timespec64 (&ts, u_ts))return -EFAULT ;trace_cobalt_clock_getres (clock_id, &ts);
testsuite/smokey/y2038/syscall-tests.c +3 -3
@@ -363,13 +363,13 @@ static int test_sc_cobalt_clock_getres64(void)struct xn_timespec64 ts64;int ret; -/* Make sure we don't crash because of NULL pointers */ - ret =XENOMAI_SYSCALL2 (sc_nr,NULL ,NULL ); +/* Make sure we accept a NULL pointer */ + ret =XENOMAI_SYSCALL2 (sc_nr,CLOCK_MONOTONIC ,NULL );if (ret == -ENOSYS ) {smokey_note ("clock_getres64: skipped. (no kernel support)" );return 0 ;// Not implemented, nothing to test, success } -if (!smokey_assert (ret == -EFAULT )) +if (!smokey_assert (ret ==0 ))return ret ? ret : -EINVAL ;/* Providing an invalid address has to deliver EFAULT */
Signature · 1 line
2.43.0
Quoted 5 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Permitted according to POSIX spec. Adjust the testsuite accordingly.
Fixes 633022801750 ("y2038: cobalt/posix/clock: Adding clock_getres64")
Quoted 32 lines
Signed-off-by Jan Kiszka <[email protected]>---
Changes in v2:
- also adjust the test casekernel/cobalt/posix/clock.c | 2 +- testsuite/smokey/y2038/syscall-tests.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)kernel/cobalt/posix/clock.c +1
-1@@ -103,7 +103,7 @@ COBALT_SYSCALL(clock_getres64, current,if (ret)return ret; -if (cobalt_put_timespec64 (&ts, u_ts)) +if (u_ts &&cobalt_put_timespec64 (&ts, u_ts))return -EFAULT ;trace_cobalt_clock_getres (clock_id, &ts);testsuite/smokey/y2038/syscall-tests.c +0
-1@@ -363,13 +363,13 @@ static int test_sc_cobalt_clock_getres64(void)struct xn_timespec64 ts64;int ret; -/* Make sure we don't crash because of NULL pointers */
testsuite/smokey/y2038/syscall-tests.c static int test_sc_cobalt_clock_getres64(void) · line 373
Quoted 10 lines
testsuite/smokey/y2038/syscall-tests.c +3
-2- ret =XENOMAI_SYSCALL2 (sc_nr,NULL ,NULL ); +/* Make sure we accept a NULL pointer */ + ret =XENOMAI_SYSCALL2 (sc_nr,CLOCK_MONOTONIC ,NULL );if (ret == -ENOSYS ) {smokey_note ("clock_getres64: skipped. (no kernel support)" );return 0 ;// Not implemented, nothing to test, success } -if (!smokey_assert (ret == -EFAULT )) +if (!smokey_assert (ret ==0 ))return ret ? ret : -EINVAL ;
Seems a pipeline run revealed the missing test adjustments ;-)
Quoted 3 lines
testsuite/smokey/y2038/syscall-tests.c +0
-0/* Providing an invalid address has to deliver EFAULT */ Signature · 1 line
2.43.0
Quoted 40 lines · Florian Bezdeka
Quoted 5 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Permitted according to POSIX spec. Adjust the testsuite accordingly.
Fixes 633022801750 ("y2038: cobalt/posix/clock: Adding clock_getres64")Reviewed-by Florian Bezdeka <[email protected]>Quoted 31 lines
Signed-off-by Jan Kiszka <[email protected]>---
Changes in v2:
- also adjust the test casekernel/cobalt/posix/clock.c | 2 +- testsuite/smokey/y2038/syscall-tests.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)kernel/cobalt/posix/clock.c +1
-1@@ -103,7 +103,7 @@ COBALT_SYSCALL(clock_getres64, current,if (ret)return ret; -if (cobalt_put_timespec64 (&ts, u_ts)) +if (u_ts &&cobalt_put_timespec64 (&ts, u_ts))return -EFAULT ;trace_cobalt_clock_getres (clock_id, &ts);testsuite/smokey/y2038/syscall-tests.c +0
-0@@ -363,13 +363,13 @@ static int test_sc_cobalt_clock_getres64(void)struct xn_timespec64 ts64;int ret;
Quoted 14 lines
testsuite/smokey/y2038/syscall-tests.c static int test_sc_cobalt_clock_getres64(void) · line 373
Quoted 11 lines
testsuite/smokey/y2038/syscall-tests.c +3
-3-/* Make sure we don't crash because of NULL pointers */ - ret =XENOMAI_SYSCALL2 (sc_nr,NULL ,NULL ); +/* Make sure we accept a NULL pointer */ + ret =XENOMAI_SYSCALL2 (sc_nr,CLOCK_MONOTONIC ,NULL );if (ret == -ENOSYS ) {smokey_note ("clock_getres64: skipped. (no kernel support)" );return 0 ;// Not implemented, nothing to test, success } -if (!smokey_assert (ret == -EFAULT )) +if (!smokey_assert (ret ==0 ))return ret ? ret : -EINVAL ;Seems a pipeline run revealed the missing test adjustments ;-)
Yes...
That should also cover you comment on v1 which I only saw now.
Jan
Quoted 5 lines
Quoted 4 lines
testsuite/smokey/y2038/syscall-tests.c +0
-0/* Providing an invalid address has to deliver EFAULT */ Signature · 1 line
2.43.0
Signature · 2 lines
Siemens AG, Foundational Technologies Linux Expert Center