1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (c) 2020 Linaro Limited. All rights reserved. 4 * Author: Viresh Kumar <viresh.kumar@linaro.org> 5 */ 6 7 #ifndef TIME64_VARIANTS_H 8 #define TIME64_VARIANTS_H 9 10 #include "config.h" 11 12 #ifdef HAVE_LIBAIO 13 #include <libaio.h> 14 #endif 15 16 #include <signal.h> 17 #include <stdio.h> 18 #include <poll.h> 19 #include <time.h> 20 #include "tst_timer.h" 21 22 struct tst_ts; 23 struct pollfd; 24 struct io_event; 25 struct sembuf; 26 struct mmsghdr; 27 28 struct time64_variants { 29 char *desc; 30 31 enum tst_ts_type ts_type; 32 int (*clock_gettime)(clockid_t clk_id, void *ts); 33 int (*clock_settime)(clockid_t clk_id, void *ts); 34 int (*clock_nanosleep)(clockid_t clock_id, int flags, void *request, void *remain); 35 36 int (*timer_gettime)(kernel_timer_t timer, void *its); 37 int (*timer_settime)(kernel_timer_t timerid, int flags, void *its, void *old_its); 38 int (*tfd_gettime)(int fd, void *its); 39 int (*tfd_settime)(int fd, int flags, void *new_value, void *old_value); 40 41 #ifdef HAVE_LIBAIO 42 int (*io_pgetevents)(io_context_t ctx, long min_nr, long max_nr, 43 struct io_event *events, void *timeout, sigset_t *sigmask); 44 #endif 45 46 int (*mqt_send)(mqd_t mqdes, const char *msg_ptr, size_t msg_len, 47 unsigned int msg_prio, void *abs_timeout); 48 ssize_t (*mqt_receive)(mqd_t mqdes, char *msg_ptr, size_t msg_len, 49 unsigned int *msg_prio, void *abs_timeout); 50 int (*ppoll)(struct pollfd *fds, nfds_t nfds, void *tmo_p, 51 const sigset_t *sigmask, size_t sigsetsize); 52 int (*sched_rr_get_interval)(pid_t pid, void *ts); 53 int (*semop)(int semid, struct sembuf *sops, size_t nsops); 54 int (*semtimedop)(int semid, struct sembuf *sops, size_t nsops, void *timeout); 55 int (*sigwait) (const sigset_t * set, siginfo_t * info, 56 void * timeout); 57 int (*recvmmsg)(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, 58 unsigned int flags, void *timeout); 59 int (*sendmmsg)(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, 60 unsigned int flags); 61 int (*utimensat)(int dirfd, const char *pathname, void *times, 62 int flags); 63 }; 64 65 #endif /* TIME64_VARIANTS_H */ 66