[LTP] [PATCH v2 1/2] syscalls/clock_gettime: create clock_gettime syscall tests

Rafael David Tinoco rafael.tinoco@linaro.org
Fri Feb 8 14:34:01 CET 2019


> diff --git a/testcases/kernel/syscalls/clock_gettime/clock_gettime02.c b/testcases/kernel/syscalls/clock_gettime/clock_gettime02.c
> new file mode 100644
> index 000000000..4db52c09d
> --- /dev/null
> +++ b/testcases/kernel/syscalls/clock_gettime/clock_gettime02.c
> @@ -0,0 +1,139 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (c) 2019 Linaro Limited. All rights reserved.
> + * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
> + */
> +/*
> + * Bad argument tests for clock_gettime(2) on multiple clocks:
> + *
> + *  1) MAX_CLOCKS
> + *  2) MAX_CLOCKS + 1
> + *  3) CLOCK_REALTIME
> + *  4) CLOCK_MONOTONIC
> + *  5) CLOCK_PROCESS_CPUTIME_ID
> + *  6) CLOCK_THREAD_CPUTIME_ID
> + *  7) CLOCK_REALTIME_COARSE
> + *  8) CLOCK_MONOTONIC_COARSE
> + *  9) CLOCK_MONOTONIC_RAW
> + * 10) CLOCK_BOOTTIME
> + */
> +
> +#include "config.h"
> +#include "tst_test.h"
> +#include "lapi/syscalls.h"
> +#include "lapi/posix_clocks.h"
> +#include "tst_timer.h"
> +#include “tst_safe_clocks.h"

<garbage>

> +#include <stdio.h>
> +
> +#define DELTA_SEC 10
> +#define NSEC_PER_SEC (1000000000L)

</garbage>

Sorry, sent out the patch too soon. Let me know if you can amend it, removing those 3 lines, or you want me to submit it again. 

Thanks a lot.


More information about the ltp mailing list