2022-06-27 08:38:00 +00:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
#ifndef LIBURING_COMPAT_H
|
|
|
|
#define LIBURING_COMPAT_H
|
|
|
|
|
|
|
|
# cmakedefine LIBURING_CONFIG_HAS_KERNEL_RWF_T
|
|
|
|
# cmakedefine LIBURING_CONFIG_HAS_KERNEL_TIMESPEC
|
|
|
|
# cmakedefine LIBURING_CONFIG_HAS_OPEN_HOW
|
|
|
|
# cmakedefine LIBURING_CONFIG_HAS_GLIBC_STATX
|
|
|
|
# cmakedefine LIBURING_CONFIG_HAS_STATX
|
|
|
|
|
|
|
|
#if !defined(LIBURING_CONFIG_HAS_KERNEL_RWF_T)
|
|
|
|
typedef int __kernel_rwf_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(LIBURING_CONFIG_HAS_KERNEL_TIMESPEC)
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
struct __kernel_timespec {
|
|
|
|
int64_t tv_sec;
|
|
|
|
long long tv_nsec;
|
|
|
|
};
|
2023-01-08 19:41:44 +00:00
|
|
|
|
|
|
|
/* <linux/time_types.h> is not available, so it can't be included */
|
|
|
|
#define UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H 1
|
|
|
|
|
2022-06-27 08:38:00 +00:00
|
|
|
#else
|
|
|
|
#include <linux/time_types.h>
|
2023-01-08 19:41:44 +00:00
|
|
|
|
|
|
|
/* <linux/time_types.h> is included above and not needed again */
|
|
|
|
#define UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H 1
|
|
|
|
|
2022-06-27 08:38:00 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(LIBURING_CONFIG_HAS_OPEN_HOW)
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
struct open_how {
|
|
|
|
uint64_t flags;
|
|
|
|
uint64_t mode;
|
|
|
|
uint64_t resolve;
|
|
|
|
};
|
2023-01-08 19:41:44 +00:00
|
|
|
#else
|
|
|
|
#include <linux/openat2.h>
|
2022-06-27 08:38:00 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(LIBURING_CONFIG_HAS_GLIBC_STATX) && defined(LIBURING_CONFIG_HAS_STATX)
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|