All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6()
@ 2020-07-29 15:26 Viresh Kumar
  2020-07-29 15:26 ` [LTP] [PATCH V8 2/2] syscalls/select6: Add support for time64 tests Viresh Kumar
  2020-08-06 13:08 ` [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6() Cyril Hrubis
  0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2020-07-29 15:26 UTC (permalink / raw)
  To: ltp

The kernel expects struct __kernel_old_timespec for __NR_pselect6
syscall.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 testcases/kernel/syscalls/select/select_var.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/select/select_var.h b/testcases/kernel/syscalls/select/select_var.h
index b19a1d1bf085..857e5d164582 100644
--- a/testcases/kernel/syscalls/select/select_var.h
+++ b/testcases/kernel/syscalls/select/select_var.h
@@ -38,7 +38,7 @@ static int do_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
 	}
 	case 2: {
 		int ret;
-		struct timespec ts = {
+		struct __kernel_old_timespec ts = {
 			.tv_sec = timeout->tv_sec,
 			.tv_nsec = timeout->tv_usec * 1000,
 		};
-- 
2.14.1


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

* [LTP] [PATCH V8 2/2] syscalls/select6: Add support for time64 tests
  2020-07-29 15:26 [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6() Viresh Kumar
@ 2020-07-29 15:26 ` Viresh Kumar
  2020-08-06 13:08 ` [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6() Cyril Hrubis
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2020-07-29 15:26 UTC (permalink / raw)
  To: ltp

This adds support for time64 tests to the existing select6() syscall
tests.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 testcases/kernel/syscalls/select/select_var.h | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/select/select_var.h b/testcases/kernel/syscalls/select/select_var.h
index 857e5d164582..86f80eeb0dc1 100644
--- a/testcases/kernel/syscalls/select/select_var.h
+++ b/testcases/kernel/syscalls/select/select_var.h
@@ -6,6 +6,7 @@
 #define SELECT_VAR__
 
 #include "lapi/syscalls.h"
+#include "tst_timer.h"
 
 struct compat_sel_arg_struct {
 	long _n;
@@ -47,7 +48,22 @@ static int do_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
 		timeout->tv_usec = ts.tv_nsec / 1000;
 		return ret;
 	}
-	case 3:
+	case 3: {
+		int ret = 0;
+#if (__NR_pselect6_time64 != __LTP__NR_INVALID_SYSCALL)
+		struct __kernel_timespec ts = {
+			.tv_sec = timeout->tv_sec,
+			.tv_nsec = timeout->tv_usec * 1000,
+		};
+		ret = tst_syscall(__NR_pselect6_time64, nfds, readfds, writefds, exceptfds, &ts, NULL);
+		timeout->tv_sec = ts.tv_sec;
+		timeout->tv_usec = ts.tv_nsec / 1000;
+#else
+		tst_brk(TCONF, "__NR_pselect6 time64 variant not supported");
+#endif
+		return ret;
+	}
+	case 4:
 #ifdef __NR__newselect
 		return tst_syscall(__NR__newselect, nfds, readfds, writefds, exceptfds, timeout);
 #else
@@ -72,11 +88,14 @@ static void select_info(void)
 		tst_res(TINFO, "Testing SYS_pselect6 syscall");
 	break;
 	case 3:
+		tst_res(TINFO, "Testing SYS_pselect6 time64 syscall");
+	break;
+	case 4:
 		tst_res(TINFO, "Testing SYS__newselect syscall");
 	break;
 	}
 }
 
-#define TEST_VARIANTS 4
+#define TEST_VARIANTS 5
 
 #endif /* SELECT_VAR__ */
-- 
2.14.1


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

* [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6()
  2020-07-29 15:26 [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6() Viresh Kumar
  2020-07-29 15:26 ` [LTP] [PATCH V8 2/2] syscalls/select6: Add support for time64 tests Viresh Kumar
@ 2020-08-06 13:08 ` Cyril Hrubis
  1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2020-08-06 13:08 UTC (permalink / raw)
  To: ltp

Hi!
Both pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

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

end of thread, other threads:[~2020-08-06 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 15:26 [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6() Viresh Kumar
2020-07-29 15:26 ` [LTP] [PATCH V8 2/2] syscalls/select6: Add support for time64 tests Viresh Kumar
2020-08-06 13:08 ` [LTP] [PATCH V8 1/2] syscalls: select: Use struct __kernel_old_timespec for pselect6() Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.