Add kmem_asprintf(), strfree(), strdup(), and minor cleanup.

This patch adds three missing Solaris functions: kmem_asprintf(), strfree(),
and strdup().  They are all implemented as a thin layer which just calls
their Linux counterparts.  As part of this an autoconf check for kvasprintf
was added because it does not appear in older kernels.  If the kernel does
not provide it then spl-generic implements it.

Additionally the dead DEBUG_KMEM_UNIMPLEMENTED code was removed to clean
things up and make the kmem.h a little more readable.
This commit is contained in:
Brian Behlendorf
2010-06-11 14:48:18 -07:00
parent bb1bb2c4c4
commit b868e22f05
5 changed files with 149 additions and 51 deletions
+14
View File
@@ -75,6 +75,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_GROUPS_SEARCH
SPL_AC_PUT_TASK_STRUCT
SPL_AC_5ARGS_PROC_HANDLER
SPL_AC_KVASPRINTF
])
AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
@@ -1399,3 +1400,16 @@ AC_DEFUN([SPL_AC_5ARGS_PROC_HANDLER], [
AC_MSG_RESULT(no)
])
])
dnl #
dnl # 2.6.x API change,
dnl # kvasprintf() function added.
dnl #
AC_DEFUN([SPL_AC_KVASPRINTF], [
SPL_CHECK_SYMBOL_EXPORT(
[kvasprintf],
[],
[AC_DEFINE(HAVE_KVASPRINTF, 1,
[kvasprintf() is available])],
[])
])