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

Rafael David Tinoco rafael.tinoco@linaro.org
Wed Mar 13 17:26:14 CET 2019


> On 13 Mar 2019, at 13:09, Cyril Hrubis <chrubis@suse.cz <mailto:chrubis@suse.cz>> wrote:
> 
> 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?

Yes, it is missing. It was added in glibc NEWS in a “new Linux interfaces” list and put into the syscalls list, but, at the moment, there is nothing wrapping it. 

> 
>> +	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 <https://lists.linux.it/listinfo/ltp>
> -- 
> Cyril Hrubis
> chrubis@suse.cz <mailto:chrubis@suse.cz>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190313/40e5e580/attachment.html>


More information about the ltp mailing list