Petr Vorel | ff3c978 | 2019-10-02 12:51:04 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Cyril Hrubis | 62fe712 | 2017-06-20 15:42:17 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz> |
Cyril Hrubis | 62fe712 | 2017-06-20 15:42:17 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * clock_gettime() and clock_getres() functions |
| 8 | */ |
| 9 | |
| 10 | #define _GNU_SOURCE |
| 11 | #include <unistd.h> |
| 12 | #include <time.h> |
| 13 | #include <sys/syscall.h> |
| 14 | |
| 15 | #include "tst_clocks.h" |
| 16 | |
| 17 | int tst_clock_getres(clockid_t clk_id, struct timespec *res) |
| 18 | { |
| 19 | return syscall(SYS_clock_getres, clk_id, res); |
| 20 | } |
| 21 | |
| 22 | int tst_clock_gettime(clockid_t clk_id, struct timespec *ts) |
| 23 | { |
| 24 | return syscall(SYS_clock_gettime, clk_id, ts); |
| 25 | } |
Rafael David Tinoco | 99ff3b8 | 2019-01-29 15:36:52 -0200 | [diff] [blame] | 26 | |
| 27 | int tst_clock_settime(clockid_t clk_id, struct timespec *ts) |
| 28 | { |
| 29 | return syscall(SYS_clock_settime, clk_id, ts); |
| 30 | } |