All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] lib: include SAFE_CLOCK_ADJTIME() macro
@ 2019-02-21 20:05 Rafael David Tinoco
  2019-02-21 20:05 ` [LTP] [PATCH 2/2] syscalls/clock_adjtime: create clock_adjtime syscall tests Rafael David Tinoco
  0 siblings, 1 reply; 37+ messages in thread
From: Rafael David Tinoco @ 2019-02-21 20:05 UTC (permalink / raw)
  To: ltp

Adds SAFE_CLOCK_ADJTIME() macro to tst_safe_clocks.h.

Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
---
 include/tst_safe_clocks.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/tst_safe_clocks.h b/include/tst_safe_clocks.h
index 553f8464a..304207f6b 100644
--- a/include/tst_safe_clocks.h
+++ b/include/tst_safe_clocks.h
@@ -6,6 +6,8 @@
 
 #include <time.h>
 #include "tst_test.h"
+#include <sys/timex.h>
+#include "lapi/syscalls.h"
 
 static inline void safe_clock_getres(const char *file, const int lineno,
 	clockid_t clk_id, struct timespec *res)
@@ -42,6 +44,17 @@ static inline void safe_clock_settime(const char *file, const int lineno,
 			"%s:%d clock_gettime() failed", file, lineno);
 }
 
+static inline void safe_clock_adjtime(const char *file, const int lineno,
+	clockid_t clk_id, struct timex *txc)
+{
+	int rval;
+
+	rval = tst_syscall(__NR_clock_adjtime, clk_id, txc);
+
+	if (rval != 0)
+		tst_brk(TBROK | TERRNO,
+			"%s:%d clock_adjtime() failed", file, lineno);
+}
 #define SAFE_CLOCK_GETRES(clk_id, res)\
 	safe_clock_getres(__FILE__, __LINE__, (clk_id), (res))
 
@@ -50,3 +63,6 @@ static inline void safe_clock_settime(const char *file, const int lineno,
 
 #define SAFE_CLOCK_SETTIME(clk_id, tp)\
 	safe_clock_settime(__FILE__, __LINE__, (clk_id), (tp))
+
+#define SAFE_CLOCK_ADJTIME(clk_id, txc)\
+	safe_clock_adjtime(__FILE__, __LINE__, (clk_id), (txc))
-- 
2.20.1


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

end of thread, other threads:[~2019-03-25 16:24 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 20:05 [LTP] [PATCH 1/2] lib: include SAFE_CLOCK_ADJTIME() macro Rafael David Tinoco
2019-02-21 20:05 ` [LTP] [PATCH 2/2] syscalls/clock_adjtime: create clock_adjtime syscall tests Rafael David Tinoco
2019-02-21 20:19   ` Rafael David Tinoco
2019-02-21 20:30   ` [LTP] [PATCH v2 1/2] lib: include SAFE_CLOCK_ADJTIME() macro Rafael David Tinoco
2019-02-21 20:30     ` [LTP] [PATCH v2 2/2] syscalls/clock_adjtime: create clock_adjtime syscall tests Rafael David Tinoco
2019-02-26  0:17       ` Petr Vorel
2019-02-26  0:24         ` Enji Cooper
2019-02-26 16:08         ` [LTP] [PATCH v3 1/2] lib: include SAFE_CLOCK_ADJTIME() macro Rafael David Tinoco
2019-02-26 16:08           ` [LTP] [PATCH v3 2/2] syscalls/clock_adjtime: create clock_adjtime syscall tests Rafael David Tinoco
2019-03-13 16:32             ` Cyril Hrubis
2019-03-15 11:07               ` Rafael David Tinoco
2019-03-20 21:41               ` [LTP] [PATCH v2 1/3] lib: include SAFE_CLOCK_ADJTIME() macro Rafael David Tinoco
2019-03-20 21:41                 ` [LTP] [PATCH v2 2/3] lapi/posix_clocks.h: add MAX_CLOCKS definition Rafael David Tinoco
2019-03-20 21:41                 ` [LTP] [PATCH v2 3/3] syscalls/clock_adjtime: create clock_adjtime syscall tests Rafael David Tinoco
2019-03-20 21:48                   ` Rafael David Tinoco
2019-03-21 13:42                     ` Cyril Hrubis
2019-03-21 13:57                       ` Rafael David Tinoco
2019-03-21 14:05                         ` Cyril Hrubis
2019-03-21 14:10                           ` Cyril Hrubis
2019-03-21 14:17                             ` Rafael David Tinoco
2019-03-21 20:27                             ` [LTP] [PATCH v3 1/4] lib: include SAFE_CLOCK_ADJTIME() macro Rafael David Tinoco
2019-03-21 20:27                               ` [LTP] [PATCH v3 2/4] lib: Add include guard to tst_safe_clocks.h Rafael David Tinoco
2019-03-21 20:27                               ` [LTP] [PATCH v3 3/4] lapi/posix_clocks.h: add MAX_CLOCKS definition Rafael David Tinoco
2019-03-21 20:27                               ` [LTP] [PATCH v3 4/4] syscalls/clock_adjtime: create clock_adjtime syscall tests Rafael David Tinoco
2019-03-21 20:31                                 ` Rafael David Tinoco
2019-03-22 13:34                                   ` Cyril Hrubis
2019-03-22 13:36                                     ` Rafael David Tinoco
2019-03-22 18:25                                     ` [LTP] [PATCH v4 1/4] lib: include SAFE_CLOCK_ADJTIME() macro Rafael David Tinoco
2019-03-22 18:25                                       ` [LTP] [PATCH v4 2/4] lib: Add include guard to tst_safe_clocks.h Rafael David Tinoco
2019-03-22 18:25                                       ` [LTP] [PATCH v4 3/4] lapi/posix_clocks.h: add MAX_CLOCKS definition Rafael David Tinoco
2019-03-22 18:25                                       ` [LTP] [PATCH v4 4/4] syscalls/clock_adjtime: create clock_adjtime syscall tests Rafael David Tinoco
2019-03-25 16:24                                       ` [LTP] [PATCH v4 1/4] lib: include SAFE_CLOCK_ADJTIME() macro Cyril Hrubis
2019-03-21 13:54                   ` [LTP] [PATCH v2 3/3] syscalls/clock_adjtime: create clock_adjtime syscall tests Cyril Hrubis
2019-03-21 14:00                     ` Rafael David Tinoco
2019-03-21 14:06                       ` Cyril Hrubis
2019-03-13 16:09           ` [LTP] [PATCH v3 1/2] lib: include SAFE_CLOCK_ADJTIME() macro Cyril Hrubis
2019-03-13 16:26             ` Rafael David Tinoco

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.