aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs_core
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-04-14 11:36:28 -0700
committerGitHub <[email protected]>2020-04-14 11:36:28 -0700
commit9f0a21e6411aa0bac23fba0ddb220342a48c7cc7 (patch)
tree63e77f57396f27dbe5c69dc11e7aeb37f9008bfc /lib/libzfs_core
parent75c62019f3938e7bc81becb4fb2d5b5eb523e79a (diff)
Add FreeBSD support to OpenZFS
Add the FreeBSD platform code to the OpenZFS repository. As of this commit the source can be compiled and tested on FreeBSD 11 and 12. Subsequent commits are now required to compile on FreeBSD and Linux. Additionally, they must pass the ZFS Test Suite on FreeBSD which is being run by the CI. As of this commit 1230 tests pass on FreeBSD and there are no unexpected failures. Reviewed-by: Sean Eric Fagan <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #898 Closes #8987
Diffstat (limited to 'lib/libzfs_core')
-rw-r--r--lib/libzfs_core/Makefile.am6
-rw-r--r--lib/libzfs_core/libzfs_core_compat.h47
2 files changed, 52 insertions, 1 deletions
diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am
index dca81e01a..617b1cf32 100644
--- a/lib/libzfs_core/Makefile.am
+++ b/lib/libzfs_core/Makefile.am
@@ -12,6 +12,10 @@ libzfs_core_la_LIBADD = \
$(top_builddir)/lib/libuutil/libuutil.la \
$(top_builddir)/lib/libzutil/libzutil.la
+if BUILD_FREEBSD
+libzfs_core_la_LDFLAGS = -version-info 3:0:0
+libzfs_core_la_LIBADD += -lutil -lgeom
+else
libzfs_core_la_LDFLAGS = -version-info 1:0:0
-
+endif
EXTRA_DIST = $(USER_C)
diff --git a/lib/libzfs_core/libzfs_core_compat.h b/lib/libzfs_core/libzfs_core_compat.h
new file mode 100644
index 000000000..6527c4b25
--- /dev/null
+++ b/lib/libzfs_core/libzfs_core_compat.h
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2013 by Martin Matuska <[email protected]>. All rights reserved.
+ */
+
+#ifndef _LIBZFS_CORE_COMPAT_H
+#define _LIBZFS_CORE_COMPAT_H
+
+#include <libnvpair.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/fs/zfs.h>
+#include <sys/zfs_ioctl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int lzc_compat_pre(zfs_cmd_t *, zfs_ioc_t *, nvlist_t **);
+void lzc_compat_post(zfs_cmd_t *, const zfs_ioc_t);
+int lzc_compat_outnvl(zfs_cmd_t *, const zfs_ioc_t, nvlist_t **);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LIBZFS_CORE_COMPAT_H */