* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include "replace.h"
+
+/*
+ * liburing.h only needs a forward declaration
+ * of struct open_how.
+ *
+ * If struct open_how is defined in liburing/compat.h
+ * itself, hide it away in order to avoid conflicts
+ * with including linux/openat2.h or defining 'struct open_how'
+ * in libreplace.
+ */
+struct open_how;
+#ifdef HAVE_STRUCT_OPEN_HOW_LIBURING_COMPAT_H
+#define open_how __ignore_liburing_compat_h_open_how
+#include <liburing/compat.h>
+#undef open_how
+#endif /* HAVE_STRUCT_OPEN_HOW_LIBURING_COMPAT_H */
+
#include "includes.h"
#include "system/filesys.h"
#include "smbd/smbd.h"
and conf.CHECK_LIB('uring', shlib=True)):
conf.CHECK_FUNCS_IN('io_uring_ring_dontfork', 'uring',
headers='liburing.h')
+ # There are a few distributions, which
+ # don't seem to have linux/openat2.h available
+ # during the liburing build, which means liburing/compat.h
+ # defines struct open_how directly instead of including
+ # linux/openat2.h, while linux/openat2.h is
+ # available on the installed system, which cause problems
+ # when we try to include both files.
+ #
+ # check if struct open_how is defined in liburing/compat.h
+ # itself and not via inclusing linux/openat2.h
+ conf.CHECK_TYPE_IN('struct open_how', 'liburing/compat.h',
+ cflags='-D_LINUX_OPENAT2_H',
+ define='HAVE_STRUCT_OPEN_HOW_LIBURING_COMPAT_H')
conf.DEFINE('HAVE_LIBURING', '1')
conf.env.build_regedit = False