From 893ed2fad07515f04723411c402617faf4c39cbd Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 18 Dec 2008 09:56:05 -0800 Subject: [PATCH 1/2] 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 Date: Thu, 18 Dec 2008 09:56:22 -0800 Subject: [PATCH 2/2] 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;