[LTP] [PATCH] syscalls/stime: Use 3 variants via test_multiplex()

Petr Vorel petr.vorel@gmail.com
Thu Mar 28 07:52:53 CET 2019


Hi Xiao,

> diff --git a/testcases/kernel/syscalls/stime/stime01.c b/testcases/kernel/syscalls/stime/stime01.c
...
> +static int do_stime(time_t *ntime)
> +{
> +	switch (tst_variant) {
> +	case 0:
> +#ifdef __ANDROID__
> +		tst_brk(TCONF, "libc stime() is not implemented for Android");
IMHO this is not optimal. 1) That might change in the future, 2) Why not to fix
it for other foo libc implementations, which might suffer the same problem.
Therefore IMHO autotools check should be used.

> +#else
> +		return stime(ntime);
> +#endif
> +	case 1:
> +		return tst_syscall(__NR_stime, ntime);
> +	case 2: {
> +		struct timeval tv;
> +
> +		tv.tv_sec = *ntime;
> +		tv.tv_usec = 0;
> +
> +		return tst_syscall(__NR_settimeofday, &tv, (struct timezone *) 0);
> +	}
> +	}

Kind regards,
Petr


More information about the ltp mailing list