From 893ed2fad07515f04723411c402617faf4c39cbd Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Thu, 18 Dec 2008 09:56:05 -0800
Subject: [PATCH 1/3] Properly cast thread functions for pthreads

---
 lib/libzpool/include/sys/zfs_context.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h
index b68078add3..f535abf4ee 100644
--- a/lib/libzpool/include/sys/zfs_context.h
+++ b/lib/libzpool/include/sys/zfs_context.h
@@ -190,12 +190,13 @@ _NOTE(CONSTCOND) } while (0)
 #define	curthread	((void *)(uintptr_t)pthread_self())
 
 typedef struct kthread kthread_t;
+typedef void (*thread_func_t)(void *);
 
 #define	thread_create(stk, stksize, func, arg, len, pp, state, pri)	\
-	zk_thread_create(func, arg)
+	zk_thread_create((thread_func_t)func, arg)
 #define	thread_exit() pthread_exit(NULL)
 
-extern kthread_t *zk_thread_create(void (*func)(void), void *arg);
+extern kthread_t *zk_thread_create(thread_func_t func, void *arg);
 
 #define	issig(why)	(FALSE)
 #define	ISSIG(thr, why)	(FALSE)

From 229aba2943e741075ad32f23ad46b8b7605a2c4c Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Thu, 18 Dec 2008 09:56:22 -0800
Subject: [PATCH 2/3] Properly cast thread functions for pthreads

---
 lib/libzpool/kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c
index b1a69b4564..25e75ee793 100644
--- a/lib/libzpool/kernel.c
+++ b/lib/libzpool/kernel.c
@@ -57,7 +57,7 @@ struct utsname utsname = {
  */
 /*ARGSUSED*/
 kthread_t *
-zk_thread_create(void (*func)(), void *arg)
+zk_thread_create(thread_func_t func, void *arg)
 {
 	pthread_t tid;
 

From c8f253cda8b3826fe609cb5365d538d3a3bb3dc8 Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Thu, 18 Dec 2008 09:58:42 -0800
Subject: [PATCH 3/3] Now fixed in fix-pthreads branch

---
 lib/libzpool/include/sys/zfs_context.h | 2 +-
 lib/libzpool/kernel.c                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h
index f924dd1a64..0e7019bba8 100644
--- a/lib/libzpool/include/sys/zfs_context.h
+++ b/lib/libzpool/include/sys/zfs_context.h
@@ -195,7 +195,7 @@ typedef struct kthread kthread_t;
 	zk_thread_create(func, arg)
 #define	thread_exit() thr_exit(NULL)
 
-extern kthread_t *zk_thread_create(void (*func)(void), void *arg);
+extern kthread_t *zk_thread_create(void (*func)(), void *arg);
 
 #define	issig(why)	(FALSE)
 #define	ISSIG(thr, why)	(FALSE)
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c
index 9740f1ba6e..fe817cc64b 100644
--- a/lib/libzpool/kernel.c
+++ b/lib/libzpool/kernel.c
@@ -56,7 +56,7 @@ struct utsname utsname = {
  */
 /*ARGSUSED*/
 kthread_t *
-zk_thread_create(void (*func)(void), void *arg)
+zk_thread_create(void (*func)(), void *arg)
 {
 	thread_t tid;