compat nvpair.h: make sure that the names are mangled only for kernel

Currently there is no good reason to mangle the userland API.
The change was introduced in eac1d566b46edef765754203bef22c75c1699966,
r279437.  Also see https://reviews.freebsd.org/D1881.

I am still convinced that nv should not have introduced intentionally
conflicting API.

Discussed with:	rstone
X-MFC with:	r279437
Sponsored by:	ClusterHQ
This commit is contained in:
avg 2015-06-07 08:54:25 +00:00
parent 4e68976c74
commit 630db52ab7

View File

@ -29,6 +29,8 @@
#ifndef _OPENSOLARIS_SYS_NVPAIR_H_
#define _OPENSOLARIS_SYS_NVPAIR_H_
#ifdef _KERNEL
/*
* Some of the symbols in the Illumos nvpair library conflict with symbols
* provided by nv(9), so we use this preprocessor hack to avoid the conflict.
@ -254,6 +256,8 @@
#define nvpair_unpack illumos_nvpair_unpack
#define nvpair_unpack_descriptor illumos_nvpair_unpack_descriptor
#endif /* _KERNEL */
#include_next <sys/nvpair.h>
#endif