All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V4 13/17] syscalls/select6: Add support for time64 tests
Date: Fri, 22 May 2020 16:21:33 +0530	[thread overview]
Message-ID: <e92928462bb2f931af55240af0e2fdd4362b302b.1590144577.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1590144577.git.viresh.kumar@linaro.org>

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 | 25 ++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/select/select_var.h b/testcases/kernel/syscalls/select/select_var.h
index b19a1d1bf085..2c7604807cf6 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;
@@ -38,7 +39,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,
 		};
@@ -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_clock_settime64 != __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.25.0.rc1.19.g042ed3e048af


  parent reply	other threads:[~2020-05-22 10:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 10:51 [LTP] [PATCH V4 00/17] Syscalls: Add support for time64 variants Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 01/17] syscalls/timer_gettime: Add support for time64 tests Viresh Kumar
2020-06-09 12:32   ` Li Wang
2020-06-10  3:26     ` Viresh Kumar
2020-06-10  3:34   ` [LTP] [PATCH V5 " Viresh Kumar
2020-06-10  3:38   ` [LTP] [PATCH V6 " Viresh Kumar
2020-06-24 14:23     ` Cyril Hrubis
2020-06-25  9:50       ` Viresh Kumar
2020-06-25 11:07         ` Cyril Hrubis
2020-06-25 11:10           ` Viresh Kumar
2020-06-25 11:13             ` Cyril Hrubis
2020-05-22 10:51 ` [LTP] [PATCH V4 02/17] syscalls/timer_settime: " Viresh Kumar
2020-06-24 14:30   ` Cyril Hrubis
2020-06-25  9:56     ` Viresh Kumar
2020-06-25 11:12       ` Cyril Hrubis
2020-05-22 10:51 ` [LTP] [PATCH V4 03/17] syscalls/timerfd: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 04/17] syscalls/sched_rr_get_interval: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 05/17] syscalls/futex: Merge futex_wait_bitset tests Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 06/17] syscalls/futex: Add support for time64 tests Viresh Kumar
2020-06-09 12:55   ` Li Wang
2020-06-10  3:35   ` [LTP] [PATCH V5 " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 07/17] syscalls/io_pgetevents: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 08/17] syscalls/sigwaitinfo: Migrate to new test framework Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 09/17] syscalls/rt_sigtimedwait: Add support for time64 tests Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 10/17] syscalls/mq_timed{send|receive}: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 11/17] syscalls/recvmmsg: " Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 12/17] syscalls/ppoll: " Viresh Kumar
2020-05-22 10:51 ` Viresh Kumar [this message]
2020-05-22 10:51 ` [LTP] [PATCH V4 14/17] syscalls/semop: Migrate to new test framework Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 15/17] syscalls/semtimedop: Add support for semtimedop and its time64 version Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 16/17] syscalls/utimensat: Migrate to new test framework Viresh Kumar
2020-05-22 10:51 ` [LTP] [PATCH V4 17/17] syscalls/utimensat: Add support for time64 tests Viresh Kumar
  -- strict thread matches above, loose matches on Subject: below --
2020-05-18  8:15 [LTP] [PATCH V3 14/17] syscalls/semop: Migrate to new test framework Viresh Kumar
2020-05-18 10:27 ` [LTP] [PATCH V4 13/17] syscalls/select6: Add support for time64 tests Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e92928462bb2f931af55240af0e2fdd4362b302b.1590144577.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.