misc/149173: [patch] [zfs] make OpenSolaris <sys/nvpair.h> installable

Robert Millan rmh at gnu.org
Sun Aug 1 12:10:04 UTC 2010

>Number:         149173
>Category:       misc
>Synopsis:       [patch] [zfs] make OpenSolaris <sys/nvpair.h> installable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 01 12:10:03 UTC 2010
>Originator:     Robert Millan
This patch makes OpenSolaris <sys/nvpair.h> buildable outside the compatibility environment, so that it can be installed system-wide, along with <libnvpair.h>, making it easier for third party apps to link with libnvpair.

It's been forwarded to OpenSolaris BTS already:
- https://defect.opensolaris.org/bz/show_bug.cgi?id=16697#c0

See also the discussion on GRUB list [1] about this problem:
- http://osdir.com/ml/grub-devel-gnu/2010-07/msg00263.html

[1] I'm in the process of adding support to GRUB for booting from ZFS



Patch attached with submission follows:

--- sys/nvpair.h.old	2010-07-31 12:03:02.038737593 -0400
+++ sys/nvpair.h	2010-07-31 12:03:08.926873793 -0400
@@ -32,6 +32,18 @@
 #include <sys/time.h>
 #include <sys/errno.h>
+/* for non-OpenSolaris systems */
+#if !defined(_KERNEL) && !defined(_BOOT)
+#include <stdint.h>	/* uintxx_t */
+#include <stdarg.h>	/* va_list */
+typedef unsigned int			uint_t;
+typedef unsigned char			uchar_t;
+typedef enum { B_FALSE, B_TRUE }	boolean_t;
+typedef long long			hrtime_t;
+typedef __va_list va_list;
 #if defined(_KERNEL) && !defined(_BOOT)
 #include <sys/kmem.h>
@@ -133,7 +145,7 @@
 } nv_alloc_t;
 struct nv_alloc_ops {
-	int (*nv_ao_init)(nv_alloc_t *, __va_list);
+	int (*nv_ao_init)(nv_alloc_t *, va_list);
 	void (*nv_ao_fini)(nv_alloc_t *);
 	void *(*nv_ao_alloc)(nv_alloc_t *, size_t);
 	void (*nv_ao_free)(nv_alloc_t *, void *, size_t);


More information about the freebsd-bugs mailing list