From b868e22f05fd85be16afee800207f72b8e310d32 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 11 Jun 2010 14:48:18 -0700 Subject: 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. --- configure | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'configure') diff --git a/configure b/configure index cbdca7759..cd227c18a 100755 --- a/configure +++ b/configure @@ -14826,6 +14826,47 @@ fi + + { $as_echo "$as_me:$LINENO: checking whether symbol kvasprintf is exported" >&5 +$as_echo_n "checking whether symbol kvasprintf is exported... " >&6; } + grep -q -E '[[:space:]]kvasprintf[[:space:]]' \ + $LINUX_OBJ/Module*.symvers 2>/dev/null + rc=$? + if test $rc -ne 0; then + export=0 + for file in ; do + grep -q -E "EXPORT_SYMBOL.*(kvasprintf)" \ + "$LINUX_OBJ/$file" 2>/dev/null + rc=$? + if test $rc -eq 0; then + export=1 + break; + fi + done + if test $export -eq 0; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + else + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_KVASPRINTF 1 +_ACEOF + + fi + else + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_KVASPRINTF 1 +_ACEOF + + fi + + ;; user) ;; all) @@ -18180,6 +18221,47 @@ fi + { $as_echo "$as_me:$LINENO: checking whether symbol kvasprintf is exported" >&5 +$as_echo_n "checking whether symbol kvasprintf is exported... " >&6; } + grep -q -E '[[:space:]]kvasprintf[[:space:]]' \ + $LINUX_OBJ/Module*.symvers 2>/dev/null + rc=$? + if test $rc -ne 0; then + export=0 + for file in ; do + grep -q -E "EXPORT_SYMBOL.*(kvasprintf)" \ + "$LINUX_OBJ/$file" 2>/dev/null + rc=$? + if test $rc -eq 0; then + export=1 + break; + fi + done + if test $export -eq 0; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + + else + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_KVASPRINTF 1 +_ACEOF + + fi + else + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_KVASPRINTF 1 +_ACEOF + + fi + + + ;; srpm) ;; *) -- cgit v1.2.3