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