From owner-svn-src-head@FreeBSD.ORG Sat Mar 14 20:10:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC607106566C; Sat, 14 Mar 2009 20:10:14 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AC1A8FC18; Sat, 14 Mar 2009 20:10:14 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2EKAEdh006948; Sat, 14 Mar 2009 20:10:14 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2EKAESF006945; Sat, 14 Mar 2009 20:10:14 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200903142010.n2EKAESF006945@svn.freebsd.org> From: David Schultz Date: Sat, 14 Mar 2009 20:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189828 - in head: include sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2009 20:10:15 -0000 Author: das Date: Sat Mar 14 20:10:14 2009 New Revision: 189828 URL: http://svn.freebsd.org/changeset/base/189828 Log: Fix the visibility of several prototypes. Also move pthread_kill() and pthread_sigmask() to signal.h. In principle, this shouldn't break anything, since they're already in signal.h on other systems, and the FreeBSD manpage says that both pthread.h and signal.h need to be included to get these functions. Add a hack to declare pthread_t in the P1003.1-2008 namespace in signal.h. Modified: head/include/pthread.h head/include/signal.h head/sys/sys/_pthreadtypes.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Sat Mar 14 20:05:27 2009 (r189827) +++ head/include/pthread.h Sat Mar 14 20:10:14 2009 (r189828) @@ -205,7 +205,6 @@ int pthread_join(pthread_t, void **); int pthread_key_create(pthread_key_t *, void (*) (void *)); int pthread_key_delete(pthread_key_t); -int pthread_kill(pthread_t, int); int pthread_mutexattr_init(pthread_mutexattr_t *); int pthread_mutexattr_destroy(pthread_mutexattr_t *); int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, @@ -241,7 +240,6 @@ int pthread_rwlockattr_setpshared(pthre int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); pthread_t pthread_self(void); int pthread_setspecific(pthread_key_t, const void *); -int pthread_sigmask(int, const __sigset_t *, __sigset_t *); int pthread_spin_init(pthread_spinlock_t *, int); int pthread_spin_destroy(pthread_spinlock_t *); @@ -253,9 +251,11 @@ int pthread_setcancelstate(int, int *); int pthread_setcanceltype(int, int *); void pthread_testcancel(void); +#if __BSD_VISIBLE int pthread_getprio(pthread_t); int pthread_setprio(pthread_t, int); void pthread_yield(void); +#endif int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, int *); @@ -281,8 +281,10 @@ int pthread_getschedparam(pthread_t pth struct sched_param *); int pthread_setschedparam(pthread_t, int, const struct sched_param *); +#if __XSI_VISIBLE int pthread_getconcurrency(void); int pthread_setconcurrency(int); +#endif void __pthread_cleanup_push_imp(void (*)(void *), void *, struct _pthread_cleanup_info *); Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Sat Mar 14 20:05:27 2009 (r189827) +++ head/include/signal.h Sat Mar 14 20:10:14 2009 (r189828) @@ -58,11 +58,22 @@ typedef __pid_t pid_t; #endif #endif +#if __POSIX_VISIBLE || __XSI_VISIBLE +struct pthread; /* XXX */ +typedef struct pthread *__pthread_t; +#if !defined(_PTHREAD_T_DECLARED) && __POSIX_VISIBLE >= 200809 +typedef __pthread_t pthread_t; +#define _PTHREAD_T_DECLARED +#endif +#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ + __BEGIN_DECLS int raise(int); #if __POSIX_VISIBLE || __XSI_VISIBLE int kill(__pid_t, int); +int pthread_kill(__pthread_t, int); +int pthread_sigmask(int, const __sigset_t *, __sigset_t *); int sigaction(int, const struct sigaction * __restrict, struct sigaction * __restrict); int sigaddset(sigset_t *, int); @@ -91,7 +102,7 @@ int sigaltstack(const stack_t * __restri int sigpause(int); #endif -#if __POSIX_VISIBLE >= 200112 +#if __XSI_VISIBLE >= 600 int siginterrupt(int, int); #endif Modified: head/sys/sys/_pthreadtypes.h ============================================================================== --- head/sys/sys/_pthreadtypes.h Sat Mar 14 20:05:27 2009 (r189827) +++ head/sys/sys/_pthreadtypes.h Sat Mar 14 20:10:14 2009 (r189828) @@ -61,7 +61,10 @@ struct pthread_spinlock; * or assignment operators for the types pthread_attr_t, pthread_cond_t, * pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. */ +#ifndef _PTHREAD_T_DECLARED typedef struct pthread *pthread_t; +#define _PTHREAD_T_DECLARED +#endif typedef struct pthread_attr *pthread_attr_t; typedef struct pthread_mutex *pthread_mutex_t; typedef struct pthread_mutex_attr *pthread_mutexattr_t;