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 LAPI_IO_PGETEVENTS_H__
8#define LAPI_IO_PGETEVENTS_H__
9
10#include <sys/syscall.h>
11#include <sys/types.h>
12
13#include "config.h"
14#include "lapi/syscalls.h"
15
16#ifdef HAVE_LIBAIO
17#include <libaio.h>
18
19static inline int sys_io_pgetevents(io_context_t ctx, long min_nr, long max_nr,
20		struct io_event *events, void *timeout, sigset_t *sigmask)
21{
22	return tst_syscall(__NR_io_pgetevents, ctx, min_nr, max_nr, events,
23			   timeout, sigmask);
24}
25
26static inline int sys_io_pgetevents_time64(io_context_t ctx, long min_nr, long max_nr,
27		struct io_event *events, void *timeout, sigset_t *sigmask)
28{
29	return tst_syscall(__NR_io_pgetevents_time64, ctx, min_nr, max_nr,
30			   events, timeout, sigmask);
31}
32
33#endif /* HAVE_LIBAIO */
34
35#endif /* LAPI_IO_PGETEVENTS_H__ */
36