• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz>
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 
tst_clock_getres(clockid_t clk_id,struct timespec * res)17 int tst_clock_getres(clockid_t clk_id, struct timespec *res)
18 {
19 	return syscall(SYS_clock_getres, clk_id, res);
20 }
21 
tst_clock_gettime(clockid_t clk_id,struct timespec * ts)22 int tst_clock_gettime(clockid_t clk_id, struct timespec *ts)
23 {
24 	return syscall(SYS_clock_gettime, clk_id, ts);
25 }
26 
tst_clock_settime(clockid_t clk_id,struct timespec * ts)27 int tst_clock_settime(clockid_t clk_id, struct timespec *ts)
28 {
29 	return syscall(SYS_clock_settime, clk_id, ts);
30 }
31