[LTP] [PATCH v3 1/2] lib: include SAFE_CLOCK_ADJTIME() macro

Cyril Hrubis chrubis@suse.cz
Wed Mar 13 17:09:41 CET 2019


Hi!
> +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);

Any reason why we don't use clock_adjtime() here?

Or is the glibc wrapper missing?

> +	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
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list