+/*
+ * No copyright is claimed. This code is in the public domain; do with
+ * it what you wish.
+ */
#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>
# define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */
#endif
+#ifndef MOVE_MOUNT_SET_GROUP
+# define MOVE_MOUNT_SET_GROUP 0x00000100 /* Set sharing group instead */
+#endif
+
#ifndef MOVE_MOUNT__MASK
# define MOVE_MOUNT__MASK 0x00000077
#endif
# define MOUNT_ATTR_NOSUID 0x00000002
#endif
+#ifndef MOUNT_ATTR_NODEV
+# define MOUNT_ATTR_NODEV 0x00000004
+#endif
+
#ifndef MOUNT_ATTR_NOEXEC
# define MOUNT_ATTR_NOEXEC 0x00000008
#endif
#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 */