summaryrefslogtreecommitdiffstats
path: root/lib/libspl/include/sys
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-03-21 16:54:59 -0700
committerBrian Behlendorf <[email protected]>2011-03-22 12:15:54 -0700
commit1073d746d6421eb5faf8a3cf8534d82a2beb0512 (patch)
treea10b3adfeab158f22b5092457719d29934b116e4 /lib/libspl/include/sys
parentd6bd8eaae4bdbce8e162414bb6c84ac95fd456b4 (diff)
Linux compat, umount2(2) flags
Older glibc <sys/mount.h> headers did not define all the available umount2(2) flags. Both MNT_FORCE and MNT_DETACH are supported in the kernel back to 2.4.11 so we define them correctly if they are missing. Closes #95
Diffstat (limited to 'lib/libspl/include/sys')
-rw-r--r--lib/libspl/include/sys/mount.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/libspl/include/sys/mount.h b/lib/libspl/include/sys/mount.h
index 9eb893fe6..d4ac6a958 100644
--- a/lib/libspl/include/sys/mount.h
+++ b/lib/libspl/include/sys/mount.h
@@ -55,7 +55,22 @@
#define MS_OWNER 0x10000000
#define MS_GROUP 0x08000000
#define MS_COMMENT 0x02000000
-#define MS_FORCE MNT_FORCE
-#define MS_DETACH MNT_DETACH
+
+/*
+ * Older glibc <sys/mount.h> headers did not define all the available
+ * umount2(2) flags. Both MNT_FORCE and MNT_DETACH are supported in the
+ * kernel back to 2.4.11 so we define them correctly if they are missing.
+ */
+#ifdef MNT_FORCE
+# define MS_FORCE MNT_FORCE
+#else
+# define MS_FORCE 0x00000001
+#endif /* MNT_FORCE */
+
+#ifdef MNT_DETACH
+# define MS_DETACH MNT_DETACH
+#else
+# define MS_DETACH 0x00000002
+#endif /* MNT_DETACH */
#endif /* _LIBSPL_SYS_MOUNT_H */