aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/lib/libspl/include/zone.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/lib/libspl/include/zone.h')
-rw-r--r--sys/contrib/openzfs/lib/libspl/include/zone.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/contrib/openzfs/lib/libspl/include/zone.h b/sys/contrib/openzfs/lib/libspl/include/zone.h
index b0ac2d9bc610..0af4e7a2fa49 100644
--- a/sys/contrib/openzfs/lib/libspl/include/zone.h
+++ b/sys/contrib/openzfs/lib/libspl/include/zone.h
@@ -33,7 +33,17 @@
extern "C" {
#endif
-#define GLOBAL_ZONEID 0
+#ifdef __FreeBSD__
+#define GLOBAL_ZONEID 0
+#else
+/*
+ * Hardcoded in the kernel's root user namespace. A "better" way to get
+ * this would be by using ioctl_ns(2), but this would need to be performed
+ * recursively on NS_GET_PARENT and then NS_GET_USERNS. Also, that's only
+ * supported since Linux 4.9.
+ */
+#define GLOBAL_ZONEID 4026531837U
+#endif
extern zoneid_t getzoneid(void);