summaryrefslogtreecommitdiffstats
path: root/kernel/tests/include/tst_safe_timerfd.h
blob: 526f128389e78e96b78f86c756c1c282e41fd76a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2020 Petr Vorel <pvorel@suse.cz>
 */

#ifndef TST_SAFE_TIMERFD_H__
#define TST_SAFE_TIMERFD_H__

#include "lapi/timerfd.h"

int safe_timerfd_create(const char *file, const int lineno,
				      int clockid, int flags);

#define SAFE_TIMERFD_CREATE(clockid, flags)\
	safe_timerfd_create(__FILE__, __LINE__, (clockid), (flags))

int safe_timerfd_gettime(const char *file, const int lineno,
				int fd, struct itimerspec *curr_value);

#define SAFE_TIMERFD_GETTIME(fd, curr_value)\
	safe_timerfd_gettime(__FILE__, __LINE__, (fd), (curr_value))

int safe_timerfd_settime(const char *file, const int lineno,
				int fd, int flags,
				const struct itimerspec *new_value,
				struct itimerspec *old_value);

#define SAFE_TIMERFD_SETTIME(fd, flags, new_value, old_value)\
	safe_timerfd_settime(__FILE__, __LINE__, (fd), (flags), (new_value), \
						 (old_value))

#endif /* SAFE_TIMERFD_H__ */