]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - include/mount-api-utils.h
Merge branch 'master' of https://github.com/BinBashBanana/util-linux
[thirdparty/util-linux.git] / include / mount-api-utils.h
index fd65bfe74d3fbe1c5cef04653f87772c05db0284..8ae546b7ed9f868931891ec0385e4e7423523388 100644 (file)
@@ -1,7 +1,11 @@
+/*
+ * 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>
@@ -50,6 +54,10 @@ static inline int open_tree(int dfd, const char *filename, unsigned int flags)
 # 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
@@ -71,6 +79,10 @@ static inline int move_mount(int from_dfd, const char *from_pathname, int to_dfd
 # 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
@@ -104,6 +116,7 @@ static inline int move_mount(int from_dfd, const char *from_pathname, int to_dfd
 #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;
@@ -111,6 +124,7 @@ struct mount_attr {
        uint64_t propagation;
        uint64_t userns_fd;
 };
+# endif
 #endif
 
 #if !defined(HAVE_MOUNT_SETATTR) && defined(SYS_mount_setattr)
@@ -122,6 +136,7 @@ static inline int mount_setattr(int dfd, const char *path, unsigned int flags,
 #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 */
@@ -132,6 +147,7 @@ enum fsconfig_command {
        FSCONFIG_CMD_CREATE     = 6,    /* Invoke superblock creation */
        FSCONFIG_CMD_RECONFIGURE = 7,   /* Invoke superblock reconfiguration */
 };
+# endif
 #endif
 
 #if !defined(HAVE_FSCONFIG) && defined(SYS_fsconfig)
@@ -187,6 +203,6 @@ static inline int fspick(int dfd, const char *pathname, unsigned int flags)
 }
 #endif
 
-#endif /* HAVE_MOUNTFD_API */
+#endif /* HAVE_MOUNTFD_API && HAVE_LINUX_MOUNT_H */
 #endif /* UTIL_LINUX_MOUNT_API_UTILS */