#ifndef UTIL_LINUX_MOUNT_API_UTILS
#define UTIL_LINUX_MOUNT_API_UTILS
-#ifdef HAVE_MOUNTFD_API
+#if defined(HAVE_MOUNTFD_API) && defined(HAVE_LINUX_MOUNT_H)
#include <sys/syscall.h>
#include <linux/mount.h>
#endif
#ifndef HAVE_STRUCT_MOUNT_ATTR
+# ifndef MOUNT_ATTR_SIZE_VER0 /* For case mount.h comes from a place invisible for autotools/meson */
# include <inttypes.h>
struct mount_attr {
uint64_t attr_set;
uint64_t propagation;
uint64_t userns_fd;
};
+# endif
#endif
#if !defined(HAVE_MOUNT_SETATTR) && defined(SYS_mount_setattr)
#endif
#ifndef HAVE_ENUM_FSCONFIG_COMMAND
+# ifndef FSOPEN_CLOEXEC /* For case mount.h comes from a place invisible for autotools/meson */
enum fsconfig_command {
FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */
FSCONFIG_SET_STRING = 1, /* Set parameter, supplying a string value */
FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */
FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
};
+# endif
#endif
#if !defined(HAVE_FSCONFIG) && defined(SYS_fsconfig)
}
#endif
-#endif /* HAVE_MOUNTFD_API */
+#endif /* HAVE_MOUNTFD_API && HAVE_LINUX_MOUNT_H */
#endif /* UTIL_LINUX_MOUNT_API_UTILS */