diff options
| author | jruoho <jruoho@NetBSD.org> | 2010-07-09 07:31:01 +0000 |
|---|---|---|
| committer | jruoho <jruoho@NetBSD.org> | 2010-07-09 07:31:01 +0000 |
| commit | 3cc3be4df9d4fbfa4c7205915565a35898ad3cb3 (patch) | |
| tree | 8474fa9c800c70276d8eafbec7a227a66d2d7b7a /lib/libpthread | |
| parent | 4964ac468f35eec370ef99ca6d09813d32ce4da0 (diff) | |
Rationalize by moving
pthread_attr_setname_np(3) to pthread_attr_getname_np(3); and
pthread_setname_np(3) to pthread_getname_np(3).
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/Makefile | 7 | ||||
| -rw-r--r-- | lib/libpthread/pthread_attr_getname_np.3 | 59 | ||||
| -rw-r--r-- | lib/libpthread/pthread_attr_setname_np.3 | 87 | ||||
| -rw-r--r-- | lib/libpthread/pthread_getname_np.3 | 50 | ||||
| -rw-r--r-- | lib/libpthread/pthread_setname_np.3 | 91 |
5 files changed, 84 insertions, 210 deletions
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index bdd834f6c39..c0db1100781 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.67 2010/07/08 22:19:26 jruoho Exp $ +# $NetBSD: Makefile,v 1.68 2010/07/09 07:31:01 jruoho Exp $ # WARNS= 4 @@ -98,7 +98,6 @@ MAN+= affinity.3 pthread.3 \ pthread_attr_getscope.3 \ pthread_attr_getstack.3 \ pthread_attr_setcreatesuspend_np.3 \ - pthread_attr_setname_np.3 \ pthread_barrier.3 pthread_barrierattr.3 \ pthread_cancel.3 pthread_cleanup_push.3 \ pthread_cond.3 pthread_condattr.3 \ @@ -110,7 +109,6 @@ MAN+= affinity.3 pthread.3 \ pthread_mutex.3 pthread_mutexattr.3 \ pthread_once.3 pthread_rwlock.3 pthread_rwlockattr.3 \ pthread_schedparam.3 pthread_self.3 \ - pthread_setname_np.3 \ pthread_setspecific.3 pthread_sigmask.3 pthread_spin.3 \ pthread_suspend_np.3 pthread_testcancel.3 @@ -123,6 +121,7 @@ MLINKS+= pthread_attr.3 pthread_attr_destroy.3 MLINKS+= pthread_attr_getdetachstate.3 pthread_attr_setdetachstate.3 MLINKS+= pthread_attr_getguardsize.3 pthread_attr_setguardsize.3 MLINKS+= pthread_attr_getinheritsched.3 pthread_attr_setinheritsched.3 +MLINKS+= pthread_attr_getname_np.3 pthread_attr_setname_np.3 MLINKS+= pthread_attr_getschedparam.3 pthread_attr_setschedparam.3 \ pthread_attr_getschedparam.3 pthread_attr_getschedpolicy.3 \ @@ -155,6 +154,8 @@ MLINKS+= pthread_cond.3 pthread_cond_timedwait.3 MLINKS+= pthread_condattr.3 pthread_condattr_init.3 MLINKS+= pthread_condattr.3 pthread_condattr_destroy.3 +MLINKS+= pthread_getname_np.3 pthread_setname_np.3 + MLINKS+= pthread_mutex.3 pthread_mutex_init.3 MLINKS+= pthread_mutex.3 pthread_mutex_destroy.3 MLINKS+= pthread_mutex.3 pthread_mutex_lock.3 diff --git a/lib/libpthread/pthread_attr_getname_np.3 b/lib/libpthread/pthread_attr_getname_np.3 index d7f53517642..45ef91dcf9b 100644 --- a/lib/libpthread/pthread_attr_getname_np.3 +++ b/lib/libpthread/pthread_attr_getname_np.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: pthread_attr_getname_np.3,v 1.3 2010/07/07 09:54:07 wiz Exp $ +.\" $NetBSD: pthread_attr_getname_np.3,v 1.4 2010/07/09 07:31:01 jruoho Exp $ .\" .\" Copyright (c)2007 YAMAMOTO Takashi, .\" All rights reserved. @@ -30,16 +30,13 @@ .Os .Sh NAME .Nm pthread_attr_getname_np -.Nd set descriptive name of an attribute +.Nd get and set descriptive name of an attribute .\" ------------------------------------------------------------ .Sh LIBRARY .Lb libpthread .\" ------------------------------------------------------------ .Sh SYNOPSIS .In pthread.h -.Ft int -.Fn pthread_attr_getname_np "const pthread_attr_t attr" "char *name" \ - "size_t len" .\" ------------------------------------------------------------ .Sh DESCRIPTION The @@ -56,21 +53,51 @@ The size of the buffer .Fa name in bytes. .El +.Pp +The +.Fn pthread_attr_setname_np +function sets the descriptive name of a thread attribute. +It takes the following arguments: +.Bl -tag -width attr -offset indent +.It Fa attr +The attribute whose descriptive name will be set. +.It Fa name +The +.Xr printf 3 +format string to be used to construct the descriptive name of the attribute. +The resulted descriptive name should be shorter than +.Dv PTHREAD_MAX_NAMELEN_NP . +.It Fa arg +The +.Xr printf 3 +argument used with +.Fa name . +.El .\" ------------------------------------------------------------ .Sh RETURN VALUES -The -.Fn pthread_attr_getname_np -function returns 0 on success. -Otherwise, an error number described in -.Xr errno 2 -is returned. +Both functions return 0 on success. +Otherwise, an error number is returned. .\" ------------------------------------------------------------ .Sh COMPATIBILITY -The -.Fn pthread_attr_getname_np -function is a non-standard extension. +Both functions are non-standard extensions. .\" ------------------------------------------------------------ -.\".Sh ERRORS +.Sh ERRORS +No errors are defined for +.Fn pthread_attr_getname_np . +.Pp +The +.Fn pthread_attr_setname_np +function may fail if: +.Bl -tag -width Er +.It Bq Er ENOMEM +There was insufficient memory for the operation. +.It Bq Er EINVAL +The supplied descriptive +.Fa name +was longer than +.Dv PTHREAD_MAX_NAMELEN_NP . +.El .\" ------------------------------------------------------------ .Sh SEE ALSO -.Xr pthread_attr_setname_np 3 +.Xr pthread_attr 3 , +.Xr pthread_getname_np 3 diff --git a/lib/libpthread/pthread_attr_setname_np.3 b/lib/libpthread/pthread_attr_setname_np.3 deleted file mode 100644 index 3445c873374..00000000000 --- a/lib/libpthread/pthread_attr_setname_np.3 +++ /dev/null @@ -1,87 +0,0 @@ -.\" $NetBSD: pthread_attr_setname_np.3,v 1.4 2010/07/07 09:54:07 wiz Exp $ -.\" -.\" Copyright (c)2007 YAMAMOTO Takashi, -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" ------------------------------------------------------------ -.Dd July 7, 2010 -.Dt PTHREAD_ATTR_SETNAME_NP 3 -.Os -.Sh NAME -.Nm pthread_attr_setname_np -.Nd set descriptive name of an attribute -.\" ------------------------------------------------------------ -.Sh LIBRARY -.Lb libpthread -.\" ------------------------------------------------------------ -.Sh SYNOPSIS -.In pthread.h -.Ft int -.Fn pthread_attr_setname_np "pthread_attr_t attr" "const char *name" \ - "void *arg" -.\" ------------------------------------------------------------ -.Sh DESCRIPTION -The -.Fn pthread_attr_setname_np -function sets the descriptive name of a thread attribute. -It takes the following arguments: -.Bl -tag -width attr -offset indent -.It Fa attr -The attribute whose descriptive name will be set. -.It Fa name -The -.Xr printf 3 -format string to be used to construct the descriptive name of the attribute. -The resulted descriptive name should be shorter than -.Dv PTHREAD_MAX_NAMELEN_NP . -.It Fa arg -The -.Xr printf 3 -argument used with -.Fa name . -.El -.\" ------------------------------------------------------------ -.Sh RETURN VALUES -The -.Fn pthread_attr_setname_np -function returns 0 on success. -Otherwise an error number is returned to indicate the error. -.\" ------------------------------------------------------------ -.Sh COMPATIBILITY -The -.Fn pthread_attr_setname_np -function is a non-standard extension. -.\" ------------------------------------------------------------ -.Sh ERRORS -The -.Fn pthread_attr_setname_np -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -Invalid parameter. -.It Bq Er ENOMEM -Insufficient memory. -.El -.Sh SEE ALSO -.Xr pthread_attr_getname_np 3 diff --git a/lib/libpthread/pthread_getname_np.3 b/lib/libpthread/pthread_getname_np.3 index 09b305c13be..db228d9972a 100644 --- a/lib/libpthread/pthread_getname_np.3 +++ b/lib/libpthread/pthread_getname_np.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: pthread_getname_np.3,v 1.3 2010/07/07 09:54:07 wiz Exp $ +.\" $NetBSD: pthread_getname_np.3,v 1.4 2010/07/09 07:31:01 jruoho Exp $ .\" .\" Copyright (c)2007 YAMAMOTO Takashi, .\" All rights reserved. @@ -25,12 +25,12 @@ .\" SUCH DAMAGE. .\" .\" ------------------------------------------------------------ -.Dd July 7, 2010 +.Dd July 9, 2010 .Dt PTHREAD_GETNAME_NP 3 .Os .Sh NAME .Nm pthread_getname_np -.Nd set descriptive name of a thread +.Nd get and set descriptive name of a thread .\" ------------------------------------------------------------ .Sh LIBRARY .Lb libpthread @@ -39,6 +39,8 @@ .In pthread.h .Ft int .Fn pthread_getname_np "pthread_t thread" "char *name" "size_t len" +.Ft int +.Fn pthread_setname_np "pthread_t thread" "const char *name" "void *arg" .\" ------------------------------------------------------------ .Sh DESCRIPTION The @@ -55,22 +57,36 @@ The size of the buffer .Fa name in bytes. .El +.Pp +The +.Fn pthread_setname_np +function sets the descriptive name of a thread. +It takes the following arguments: +.Bl -tag -width target -offset indent +.It Fa thread +The thread whose descriptive name will be set. +.It Fa name +The +.Xr printf 3 +format string to be used to construct the descriptive name of the thread. +The resulted descriptive name should be shorter than +.Dv PTHREAD_MAX_NAMELEN_NP . +.It Fa arg +The +.Xr printf 3 +argument used with +.Fa name . +.El .\" ------------------------------------------------------------ .Sh RETURN VALUES -The -.Fn pthread_getname_np -function returns 0 on success. +Both functions return 0 on success. Otherwise, an error number is returned to indicate the error. .\" ------------------------------------------------------------ .Sh COMPATIBILITY -The -.Fn pthread_getname_np -function is a non-standard extension. +Both functions are non-standard extensions. .\" ------------------------------------------------------------ .Sh ERRORS -The -.Fn pthread_getname_np -function will fail if: +Both functions may fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid parameter. @@ -78,6 +94,14 @@ Invalid parameter. Non-existent .Fa thread . .El +.Pp +The +.Fn pthread_setname_np +function may also fail if: +.Bl -tag -width Er +.It Bq Er ENOMEM +There was insufficient memory for the operation. +.El .Sh SEE ALSO .Xr pthread_attr_get_np 3 , -.Xr pthread_setname_np 3 +.Xr pthread_attr_getname_np 3 diff --git a/lib/libpthread/pthread_setname_np.3 b/lib/libpthread/pthread_setname_np.3 deleted file mode 100644 index 77d66c3719e..00000000000 --- a/lib/libpthread/pthread_setname_np.3 +++ /dev/null @@ -1,91 +0,0 @@ -.\" $NetBSD: pthread_setname_np.3,v 1.4 2010/07/07 09:54:07 wiz Exp $ -.\" -.\" Copyright (c)2007 YAMAMOTO Takashi, -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" ------------------------------------------------------------ -.Dd July 7, 2010 -.Dt PTHREAD_SETNAME_NP 3 -.Os -.Sh NAME -.Nm pthread_setname_np -.Nd set descriptive name of a thread -.\" ------------------------------------------------------------ -.Sh LIBRARY -.Lb libpthread -.\" ------------------------------------------------------------ -.Sh SYNOPSIS -.In pthread.h -.Ft int -.Fn pthread_setname_np "pthread_t thread" "const char *name" "void *arg" -.\" ------------------------------------------------------------ -.Sh DESCRIPTION -The -.Fn pthread_setname_np -function sets the descriptive name of a thread. -It takes the following arguments: -.Bl -tag -width target -offset indent -.It Fa thread -The thread whose descriptive name will be set. -.It Fa name -The -.Xr printf 3 -format string to be used to construct the descriptive name of the thread. -The resulted descriptive name should be shorter than -.Dv PTHREAD_MAX_NAMELEN_NP . -.It Fa arg -The -.Xr printf 3 -argument used with -.Fa name . -.El -.\" ------------------------------------------------------------ -.Sh RETURN VALUES -The -.Fn pthread_setname_np -function returns 0 on success. -Otherwise, -an error number is returned to indicate the error. -.\" ------------------------------------------------------------ -.Sh COMPATIBILITY -The -.Fn pthread_setname_np -function is a non-standard extension. -.\" ------------------------------------------------------------ -.Sh ERRORS -The -.Fn pthread_setname_np -function will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -Invalid parameter. -.It Bq Er ENOMEM -Insufficient memory. -.It Bq Er ESRCH -Non-existent -.Fa thread . -.El -.Sh SEE ALSO -.Xr pthread 3 , -.Xr pthread_getname_np 3 |
