$NetBSD: patch-bk,v 1.1.1.1 2005/05/04 08:56:50 agc Exp $ Index: include/nasd/nasd_threads_pthread.h =================================================================== RCS file: /usr/cvsroot/nasd/nasd-1.3/include/nasd/nasd_threads_pthread.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- include/nasd/nasd_threads_pthread.h 21 Mar 2005 08:52:03 -0000 1.1.1.1 +++ include/nasd/nasd_threads_pthread.h 21 Mar 2005 17:07:28 -0000 1.2 @@ -52,15 +52,16 @@ typedef void * (*pthread_startroutine_t)(void *); #endif /* LINUX && !LINUX__NASD_PTHREAD_EXTRAS_DEFINED */ -#ifdef FREEBSD +#if defined(FREEBSD) || defined(NETBSD) typedef void (*pthread_initroutine_t)(void); +typedef void * (*pthread_startroutine_t)(void *); #define pthread_mutexattr_create(_attrp_) pthread_mutexattr_init(_attrp_) #define pthread_mutexattr_delete(_attrp_) pthread_mutexattr_destroy(_attrp_) #define pthread_condattr_create(_attrp_) pthread_condattr_init(_attrp_) #define pthread_condattr_delete(_attrp_) pthread_condattr_destroy(_attrp_) #define pthread_attr_create(_attrp_) pthread_attr_init(_attrp_) #define pthread_attr_delete(_attrp_) pthread_attr_destroy(_attrp_) -#endif /* FREEBSD */ +#endif /* FREEBSD || NETBSD */ #ifdef SOLARIS typedef void (*pthread_initroutine_t)(void); @@ -164,11 +165,11 @@ #define NASD_SYS_SIGNAL_COND(_c_) pthread_cond_signal( &(_c_) ) #define NASD_SYS_BROADCAST_COND(_c_) pthread_cond_broadcast(&(_c_)) -#if defined(LINUX) || defined(FREEBSD) || defined(IRIX) +#if defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || defined(IRIX) #define NASD_DECLARE_ONCE(_o_) pthread_once_t _o_ = PTHREAD_ONCE_INIT; -#else /* LINUX || FREEBSD || IRIX */ +#else /* LINUX || FREEBSD || NETBSD || IRIX */ #define NASD_DECLARE_ONCE(_o_) pthread_once_t _o_ = {0,0,0}; -#endif /* LINUX || FREEBSD || IRIX */ +#endif /* LINUX || FREEBSD || NETBSD || IRIX */ extern int _nasd_once(pthread_once_t *once_block, pthread_initroutine_t init_routine, char *file, int line); @@ -188,14 +189,14 @@ #define NASD_EXIT_THREAD(_status_) pthread_exit( (void *) (_status_) ) #endif /* DEC_OSF */ -#if (defined(LINUX) && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || defined(FREEBSD) +#if (defined(LINUX) && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || defined(FREEBSD) || defined(NETBSD) #define NASD_DELAY_THREAD(_secs_,_nsecs_) { \ struct timeval _interval; \ _interval.tv_sec = (_secs_); \ _interval.tv_usec = (_nsecs_) / 1000; \ select(1, NULL, NULL, NULL, &_interval); \ } -#else /* (LINUX && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || FREEBSD */ +#else /* (LINUX && (NASD_RPC_PACKAGE != NASD_RPC_PACKAGE_DCE)) || FREEBSD || NETBSD */ #define NASD_DELAY_THREAD(_secs_,_nsecs_) { \ struct timespec _interval; \ _interval.tv_sec = (_secs_); \ @@ -212,9 +213,9 @@ #define nasd_thread_self() ((nasd_thread_id_t)(pthread_self().field1)) #endif /* DEC_OSF */ -#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(IRIX) +#if defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || defined(SOLARIS) || defined(IRIX) #define nasd_thread_self() ((nasd_thread_id_t)(pthread_self())) -#endif /* LINUX || FREEBSD || SOLARIS || IRIX */ +#endif /* LINUX || FREEBSD || NETBSD || SOLARIS || IRIX */ #if defined(LINUX) && (NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE) /* pthreads forgets to prototype these, so we do so here (to avoid warnings) */