Index: head/share/man/man3/makedev.3 =================================================================== --- head/share/man/man3/makedev.3 (revision 276260) +++ head/share/man/man3/makedev.3 (revision 276261) @@ -1,90 +1,90 @@ .\" Copyright (c) 2008 Ed Schouten .\" 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. .\" .\" $FreeBSD$ .\" .Dd September 28, 2008 .Dt MAKEDEV 3 .Os .Sh NAME .Nm makedev , .Nm major , .Nm minor .Nd device number conversion .Sh SYNOPSIS .In sys/types.h .Ft dev_t .Fn makedev "int major" "int minor" .Ft int .Fn major "dev_t dev" .Ft int .Fn minor "dev_t dev" .Sh DESCRIPTION The .Fn makedev macro allows a unique device number to be generated based on its .Fa major and .Fa minor number. The .Fn major and .Fn minor macros can be used to obtain the original numbers from the device number .Fa dev . .Pp In previous implementations of .Fx all block and character devices were uniquely identified by a pair of major and minor numbers. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of .Fx automatically generate a unique device number for each character device visible in .Pa /dev/ . These numbers are not divided in device classes. .Pp On .Fx these macros are only used by utilities that need to exchange numbers with other operating systems that may use different encodings for .Vt dev_t , but also applications that present these numbers to the user in a more conventional way. .Sh RETURN VALUES The .Fn major macro returns a device major number that has a value between 0 and 255. The .Fn minor macro returns a device minor number whose value can span the complete range of an .Vt int . .Sh SEE ALSO -.Xr devfs 5 , +.Xr mknod 2 , .Xr devname 3 , -.Xr mknod 2 +.Xr devfs 5 Index: head/share/man/man3/pthread.3 =================================================================== --- head/share/man/man3/pthread.3 (revision 276260) +++ head/share/man/man3/pthread.3 (revision 276261) @@ -1,550 +1,550 @@ .\" Copyright (c) 1996 John Birrell . .\" 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. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by John Birrell. .\" 4. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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 REGENTS 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. .\" .\" $FreeBSD$ .\" .Dd August 12, 2014 .Dt PTHREAD 3 .Os .Sh NAME .Nm pthread .Nd POSIX thread functions .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Sh DESCRIPTION POSIX threads are a set of functions that support applications with requirements for multiple flows of control, called .Em threads , within a process. Multithreading is used to improve the performance of a program. .Pp The POSIX thread functions are summarized in this section in the following groups: .Pp .Bl -bullet -offset indent -compact .It Thread Routines .It Attribute Object Routines .It Mutex Routines .It Condition Variable Routines .It Read/Write Lock Routines .It Per-Thread Context Routines .It Cleanup Routines .El .Ss Thread Routines .Bl -tag -width indent .It Xo .Ft int .Fo pthread_create .Fa "pthread_t *thread" "const pthread_attr_t *attr" .Fa "void *\*[lp]*start_routine\*[rp]\*[lp]void *\*[rp]" "void *arg" .Fc .Xc Creates a new thread of execution. .It Xo .Ft int .Fn pthread_cancel "pthread_t thread" .Xc Cancels execution of a thread. .It Xo .Ft int .Fn pthread_detach "pthread_t thread" .Xc Marks a thread for deletion. .It Xo .Ft int .Fn pthread_equal "pthread_t t1" "pthread_t t2" .Xc Compares two thread IDs. .It Xo .Ft void .Fn pthread_exit "void *value_ptr" .Xc Terminates the calling thread. .It Xo .Ft int .Fn pthread_join "pthread_t thread" "void **value_ptr" .Xc Causes the calling thread to wait for the termination of the specified thread. .It Xo .Ft int .Fn pthread_kill "pthread_t thread" "int sig" .Xc Delivers a signal to a specified thread. .It Xo .Ft int .Fn pthread_once "pthread_once_t *once_control" "void \*[lp]*init_routine\*[rp]\*[lp]void\*[rp]" .Xc Calls an initialization routine once. .It Xo .Ft pthread_t .Fn pthread_self void .Xc Returns the thread ID of the calling thread. .It Xo .Ft int .Fn pthread_setcancelstate "int state" "int *oldstate" .Xc Sets the current thread's cancelability state. .It Xo .Ft int .Fn pthread_setcanceltype "int type" "int *oldtype" .Xc Sets the current thread's cancelability type. .It Xo .Ft void .Fn pthread_testcancel void .Xc Creates a cancellation point in the calling thread. .It Xo .Ft void .Fn pthread_yield void .Xc Allows the scheduler to run another thread instead of the current one. .El .Ss Attribute Object Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_attr_destroy "pthread_attr_t *attr" .Xc Destroy a thread attributes object. .It Xo .Ft int .Fo pthread_attr_getinheritsched .Fa "const pthread_attr_t *attr" "int *inheritsched" .Fc .Xc Get the inherit scheduling attribute from a thread attributes object. .It Xo .Ft int .Fo pthread_attr_getschedparam .Fa "const pthread_attr_t *attr" "struct sched_param *param" .Fc .Xc Get the scheduling parameter attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getschedpolicy "const pthread_attr_t *attr" "int *policy" .Xc Get the scheduling policy attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getscope "const pthread_attr_t *attr" "int *contentionscope" .Xc Get the contention scope attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize" .Xc Get the stack size attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getstackaddr "const pthread_attr_t *attr" "void **stackaddr" .Xc Get the stack address attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_getdetachstate "const pthread_attr_t *attr" "int *detachstate" .Xc Get the detach state attribute from a thread attributes object. .It Xo .Ft int .Fn pthread_attr_init "pthread_attr_t *attr" .Xc Initialize a thread attributes object with default values. .It Xo .Ft int .Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched" .Xc Set the inherit scheduling attribute in a thread attributes object. .It Xo .Ft int .Fo pthread_attr_setschedparam .Fa "pthread_attr_t *attr" "const struct sched_param *param" .Fc .Xc Set the scheduling parameter attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy" .Xc Set the scheduling policy attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setscope "pthread_attr_t *attr" "int contentionscope" .Xc Set the contention scope attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize" .Xc Set the stack size attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setstackaddr "pthread_attr_t *attr" "void *stackaddr" .Xc Set the stack address attribute in a thread attributes object. .It Xo .Ft int .Fn pthread_attr_setdetachstate "pthread_attr_t *attr" "int detachstate" .Xc Set the detach state in a thread attributes object. .El .Ss Mutex Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_mutexattr_destroy "pthread_mutexattr_t *attr" .Xc Destroy a mutex attributes object. .It Xo .Ft int .Fn pthread_mutexattr_getprioceiling "pthread_mutexattr_t *attr" "int *ceiling" .Xc Obtain priority ceiling attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_getprotocol "pthread_mutexattr_t *attr" "int *protocol" .Xc Obtain protocol attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_gettype "pthread_mutexattr_t *attr" "int *type" .Xc Obtain the mutex type attribute in the specified mutex attributes object. .It Xo .Ft int .Fn pthread_mutexattr_init "pthread_mutexattr_t *attr" .Xc Initialize a mutex attributes object with default values. .It Xo .Ft int .Fn pthread_mutexattr_setprioceiling "pthread_mutexattr_t *attr" "int ceiling" .Xc Set priority ceiling attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_setprotocol "pthread_mutexattr_t *attr" "int protocol" .Xc Set protocol attribute of mutex attribute object. .It Xo .Ft int .Fn pthread_mutexattr_settype "pthread_mutexattr_t *attr" "int type" .Xc Set the mutex type attribute that is used when a mutex is created. .It Xo .Ft int .Fn pthread_mutex_destroy "pthread_mutex_t *mutex" .Xc Destroy a mutex. .It Xo .Ft int .Fo pthread_mutex_init .Fa "pthread_mutex_t *mutex" "const pthread_mutexattr_t *attr" .Fc .Xc Initialize a mutex with specified attributes. .It Xo .Ft int .Fn pthread_mutex_lock "pthread_mutex_t *mutex" .Xc Lock a mutex and block until it becomes available. .It Xo .Ft int .Fo pthread_mutex_timedlock .Fa "pthread_mutex_t *mutex" "const struct timespec *abstime" .Fc .Xc Lock a mutex and block until it becomes available or until the timeout expires. .It Xo .Ft int .Fn pthread_mutex_trylock "pthread_mutex_t *mutex" .Xc Try to lock a mutex, but do not block if the mutex is locked by another thread, including the current thread. .It Xo .Ft int .Fn pthread_mutex_unlock "pthread_mutex_t *mutex" .Xc Unlock a mutex. .El .Ss Condition Variable Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_condattr_destroy "pthread_condattr_t *attr" .Xc Destroy a condition variable attributes object. .It Xo .Ft int .Fn pthread_condattr_init "pthread_condattr_t *attr" .Xc Initialize a condition variable attributes object with default values. .It Xo .Ft int .Fn pthread_cond_broadcast "pthread_cond_t *cond" .Xc Unblock all threads currently blocked on the specified condition variable. .It Xo .Ft int .Fn pthread_cond_destroy "pthread_cond_t *cond" .Xc Destroy a condition variable. .It Xo .Ft int .Fn pthread_cond_init "pthread_cond_t *cond" "const pthread_condattr_t *attr" .Xc Initialize a condition variable with specified attributes. .It Xo .Ft int .Fn pthread_cond_signal "pthread_cond_t *cond" .Xc Unblock at least one of the threads blocked on the specified condition variable. .It Xo .Ft int .Fo pthread_cond_timedwait .Fa "pthread_cond_t *cond" "pthread_mutex_t *mutex" .Fa "const struct timespec *abstime" .Fc .Xc Unlock the specified mutex, wait no longer than the specified time for a condition, and then relock the mutex. .It Xo .Ft int .Fn pthread_cond_wait "pthread_cond_t *" "pthread_mutex_t *mutex" .Xc Unlock the specified mutex, wait for a condition, and relock the mutex. .El .Ss Read/Write Lock Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_rwlock_destroy "pthread_rwlock_t *lock" .Xc Destroy a read/write lock object. .It Xo .Ft int .Fo pthread_rwlock_init .Fa "pthread_rwlock_t *lock" "const pthread_rwlockattr_t *attr" .Fc .Xc Initialize a read/write lock object. .It Xo .Ft int .Fn pthread_rwlock_rdlock "pthread_rwlock_t *lock" .Xc Lock a read/write lock for reading, blocking until the lock can be acquired. .It Xo .Ft int .Fn pthread_rwlock_tryrdlock "pthread_rwlock_t *lock" .Xc Attempt to lock a read/write lock for reading, without blocking if the lock is unavailable. .It Xo .Ft int .Fn pthread_rwlock_trywrlock "pthread_rwlock_t *lock" .Xc Attempt to lock a read/write lock for writing, without blocking if the lock is unavailable. .It Xo .Ft int .Fn pthread_rwlock_unlock "pthread_rwlock_t *lock" .Xc Unlock a read/write lock. .It Xo .Ft int .Fn pthread_rwlock_wrlock "pthread_rwlock_t *lock" .Xc Lock a read/write lock for writing, blocking until the lock can be acquired. .It Xo .Ft int .Fn pthread_rwlockattr_destroy "pthread_rwlockattr_t *attr" .Xc Destroy a read/write lock attribute object. .It Xo .Ft int .Fo pthread_rwlockattr_getpshared .Fa "const pthread_rwlockattr_t *attr" "int *pshared" .Fc .Xc Retrieve the process shared setting for the read/write lock attribute object. .It Xo .Ft int .Fn pthread_rwlockattr_init "pthread_rwlockattr_t *attr" .Xc Initialize a read/write lock attribute object. .It Xo .Ft int .Fn pthread_rwlockattr_setpshared "pthread_rwlockattr_t *attr" "int pshared" .Xc Set the process shared setting for the read/write lock attribute object. .El .Ss Per-Thread Context Routines .Bl -tag -width indent .It Xo .Ft int .Fn pthread_key_create "pthread_key_t *key" "void \*[lp]*routine\*[rp]\*[lp]void *\*[rp]" .Xc Create a thread-specific data key. .It Xo .Ft int .Fn pthread_key_delete "pthread_key_t key" .Xc Delete a thread-specific data key. .It Xo .Ft "void *" .Fn pthread_getspecific "pthread_key_t key" .Xc Get the thread-specific value for the specified key. .It Xo .Ft int .Fn pthread_setspecific "pthread_key_t key" "const void *value_ptr" .Xc Set the thread-specific value for the specified key. .El .Ss Cleanup Routines .Bl -tag -width indent .It Xo .Ft int .Fo pthread_atfork .Fa "void \*[lp]*prepare\*[rp]\*[lp]void\*[rp]" .Fa "void \*[lp]*parent\*[rp]\*[lp]void\*[rp]" .Fa "void \*[lp]*child\*[rp]\*[lp]void\*[rp]" .Fc .Xc Register fork handlers. .It Xo .Ft void .Fn pthread_cleanup_pop "int execute" .Xc Remove the routine at the top of the calling thread's cancellation cleanup stack and optionally invoke it. .It Xo .Ft void .Fn pthread_cleanup_push "void \*[lp]*routine\*[rp]\*[lp]void *\*[rp]" "void *routine_arg" .Xc Push the specified cancellation cleanup handler onto the calling thread's cancellation stack. .El .Sh IMPLEMENTATION NOTES The current .Fx POSIX thread implementation is built into the .Lb libthr library. It contains thread-safe versions of .Lb libc functions and the thread functions. Threaded applications are linked with this library. .Sh SEE ALSO .Xr libthr 3 , .Xr pthread_affinity_np 3 , .Xr pthread_atfork 3 , .Xr pthread_attr 3 , .Xr pthread_cancel 3 , .Xr pthread_cleanup_pop 3 , .Xr pthread_cleanup_push 3 , -.Xr pthread_condattr_destroy 3 , -.Xr pthread_condattr_init 3 , .Xr pthread_cond_broadcast 3 , .Xr pthread_cond_destroy 3 , .Xr pthread_cond_init 3 , .Xr pthread_cond_signal 3 , .Xr pthread_cond_timedwait 3 , .Xr pthread_cond_wait 3 , +.Xr pthread_condattr_destroy 3 , +.Xr pthread_condattr_init 3 , .Xr pthread_create 3 , .Xr pthread_detach 3 , .Xr pthread_equal 3 , .Xr pthread_exit 3 , .Xr pthread_getspecific 3 , .Xr pthread_join 3 , .Xr pthread_key_delete 3 , .Xr pthread_kill 3 , +.Xr pthread_mutex_destroy 3 , +.Xr pthread_mutex_init 3 , +.Xr pthread_mutex_lock 3 , +.Xr pthread_mutex_trylock 3 , +.Xr pthread_mutex_unlock 3 , .Xr pthread_mutexattr_destroy 3 , .Xr pthread_mutexattr_getprioceiling 3 , .Xr pthread_mutexattr_getprotocol 3 , .Xr pthread_mutexattr_gettype 3 , .Xr pthread_mutexattr_init 3 , .Xr pthread_mutexattr_setprioceiling 3 , .Xr pthread_mutexattr_setprotocol 3 , .Xr pthread_mutexattr_settype 3 , -.Xr pthread_mutex_destroy 3 , -.Xr pthread_mutex_init 3 , -.Xr pthread_mutex_lock 3 , -.Xr pthread_mutex_trylock 3 , -.Xr pthread_mutex_unlock 3 , .Xr pthread_once 3 , -.Xr pthread_rwlockattr_destroy 3 , -.Xr pthread_rwlockattr_getpshared 3 , -.Xr pthread_rwlockattr_init 3 , -.Xr pthread_rwlockattr_setpshared 3 , .Xr pthread_rwlock_destroy 3 , .Xr pthread_rwlock_init 3 , .Xr pthread_rwlock_rdlock 3 , .Xr pthread_rwlock_unlock 3 , .Xr pthread_rwlock_wrlock 3 , +.Xr pthread_rwlockattr_destroy 3 , +.Xr pthread_rwlockattr_getpshared 3 , +.Xr pthread_rwlockattr_init 3 , +.Xr pthread_rwlockattr_setpshared 3 , .Xr pthread_self 3 , .Xr pthread_setcancelstate 3 , .Xr pthread_setcanceltype 3 , .Xr pthread_setspecific 3 , .Xr pthread_testcancel 3 .Sh STANDARDS The functions with the .Nm pthread_ prefix and not .Nm _np suffix or .Nm pthread_rwlock prefix conform to .St -p1003.1-96 . .Pp The functions with the .Nm pthread_ prefix and .Nm _np suffix are non-portable extensions to POSIX threads. .Pp The functions with the .Nm pthread_rwlock prefix are extensions created by The Open Group as part of the .St -susv2 . Index: head/share/man/man3/pthread_attr.3 =================================================================== --- head/share/man/man3/pthread_attr.3 (revision 276260) +++ head/share/man/man3/pthread_attr.3 (revision 276261) @@ -1,238 +1,238 @@ .\" Copyright (C) 2000 Jason Evans . .\" 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(s), this list of conditions and the following disclaimer as .\" the first lines of this file unmodified other than the possible .\" addition of one or more copyright notices. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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. .\" .\" $FreeBSD$ .Dd January 8, 2010 .Dt PTHREAD_ATTR 3 .Os .Sh NAME .Nm pthread_attr_init , .Nm pthread_attr_destroy , .Nm pthread_attr_setstack , .Nm pthread_attr_getstack , .Nm pthread_attr_setstacksize , .Nm pthread_attr_getstacksize , .Nm pthread_attr_setguardsize , .Nm pthread_attr_getguardsize , .Nm pthread_attr_setstackaddr , .Nm pthread_attr_getstackaddr , .Nm pthread_attr_setdetachstate , .Nm pthread_attr_getdetachstate , .Nm pthread_attr_setinheritsched , .Nm pthread_attr_getinheritsched , .Nm pthread_attr_setschedparam , .Nm pthread_attr_getschedparam , .Nm pthread_attr_setschedpolicy , .Nm pthread_attr_getschedpolicy , .Nm pthread_attr_setscope , .Nm pthread_attr_getscope .Nd thread attribute operations .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_attr_init "pthread_attr_t *attr" .Ft int .Fn pthread_attr_destroy "pthread_attr_t *attr" .Ft int .Fn pthread_attr_setstack "pthread_attr_t *attr" " void *stackaddr" "size_t stacksize" .Ft int .Fn pthread_attr_getstack "const pthread_attr_t * restrict attr" "void ** restrict stackaddr" "size_t * restrict stacksize" .Ft int .Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize" .Ft int .Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize" .Ft int .Fn pthread_attr_setguardsize "pthread_attr_t *attr" "size_t guardsize" .Ft int .Fn pthread_attr_getguardsize "const pthread_attr_t *attr" "size_t *guardsize" .Ft int .Fn pthread_attr_setstackaddr "pthread_attr_t *attr" "void *stackaddr" .Ft int .Fn pthread_attr_getstackaddr "const pthread_attr_t *attr" "void **stackaddr" .Ft int .Fn pthread_attr_setdetachstate "pthread_attr_t *attr" "int detachstate" .Ft int .Fn pthread_attr_getdetachstate "const pthread_attr_t *attr" "int *detachstate" .Ft int .Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched" .Ft int .Fn pthread_attr_getinheritsched "const pthread_attr_t *attr" "int *inheritsched" .Ft int .Fn pthread_attr_setschedparam "pthread_attr_t *attr" "const struct sched_param *param" .Ft int .Fn pthread_attr_getschedparam "const pthread_attr_t *attr" "struct sched_param *param" .Ft int .Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy" .Ft int .Fn pthread_attr_getschedpolicy "const pthread_attr_t *attr" "int *policy" .Ft int .Fn pthread_attr_setscope "pthread_attr_t *attr" "int contentionscope" .Ft int .Fn pthread_attr_getscope "const pthread_attr_t *attr" "int *contentionscope" .Sh DESCRIPTION Thread attributes are used to specify parameters to .Fn pthread_create . One attribute object can be used in multiple calls to .Fn pthread_create , with or without modifications between calls. .Pp The .Fn pthread_attr_init function initializes .Fa attr with all the default thread attributes. .Pp The .Fn pthread_attr_destroy function destroys .Fa attr . .Pp The .Fn pthread_attr_set* functions set the attribute that corresponds to each function name. .Pp The .Fn pthread_attr_get* functions copy the value of the attribute that corresponds to each function name to the location pointed to by the second function parameter. .Sh RETURN VALUES If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. .Sh ERRORS The .Fn pthread_attr_init function will fail if: .Bl -tag -width Er .It Bq Er ENOMEM Out of memory. .El .Pp The .Fn pthread_attr_destroy function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for .Fa attr . .El .Pp The .Fn pthread_attr_setstacksize and .Fn pthread_attr_setstack functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL .Fa stacksize is less than .Dv PTHREAD_STACK_MIN . .El .Pp The .Fn pthread_attr_setdetachstate function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for .Fa detachstate . .El .Pp The .Fn pthread_attr_setinheritsched function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for .Fa attr . .El .Pp The .Fn pthread_attr_setschedparam function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for .Fa attr . .It Bq Er ENOTSUP Invalid value for .Fa param . .El .Pp The .Fn pthread_attr_setschedpolicy function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for .Fa attr . .It Bq Er ENOTSUP Invalid or unsupported value for .Fa policy . .El .Pp The .Fn pthread_attr_setscope function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for .Fa attr . .It Bq Er ENOTSUP Invalid or unsupported value for .Fa contentionscope . .El .Sh SEE ALSO -.Xr pthread_attr_get_np 3 , .Xr pthread_attr_affinity_np 3 , +.Xr pthread_attr_get_np 3 , .Xr pthread_create 3 .Sh STANDARDS .Fn pthread_attr_init , .Fn pthread_attr_destroy , .Fn pthread_attr_setstacksize , .Fn pthread_attr_getstacksize , .Fn pthread_attr_setstackaddr , .Fn pthread_attr_getstackaddr , .Fn pthread_attr_setdetachstate , and .Fn pthread_attr_getdetachstate functions conform to .St -p1003.1-96 .Pp The .Fn pthread_attr_setinheritsched , .Fn pthread_attr_getinheritsched , .Fn pthread_attr_setschedparam , .Fn pthread_attr_getschedparam , .Fn pthread_attr_setschedpolicy , .Fn pthread_attr_getschedpolicy , .Fn pthread_attr_setscope , and .Fn pthread_attr_getscope functions conform to .St -susv2 Index: head/share/man/man3/pthread_cond_init.3 =================================================================== --- head/share/man/man3/pthread_cond_init.3 (revision 276260) +++ head/share/man/man3/pthread_cond_init.3 (revision 276261) @@ -1,83 +1,83 @@ .\" Copyright (c) 1997 Brian Cully .\" 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. .\" 3. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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 REGENTS 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. .\" .\" $FreeBSD$ .\" .Dd November 4, 2006 .Dt PTHREAD_COND_INIT 3 .Os .Sh NAME .Nm pthread_cond_init .Nd create a condition variable .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_cond_init "pthread_cond_t *cond" "const pthread_condattr_t *attr" .Sh DESCRIPTION The .Fn pthread_cond_init function creates a new condition variable, with attributes specified with .Fa attr . If .Fa attr is NULL the default attributes are used. .Sh RETURN VALUES If successful, the .Fn pthread_cond_init function will return zero and put the new condition variable id into .Fa cond , otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_cond_init function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr is invalid. .It Bq Er ENOMEM The process cannot allocate enough memory to create another condition variable. .It Bq Er EAGAIN The system temporarily lacks the resources to create another condition variable. .El .Sh SEE ALSO -.Xr pthread_condattr 3 , .Xr pthread_cond_broadcast 3 , .Xr pthread_cond_destroy 3 , .Xr pthread_cond_signal 3 , .Xr pthread_cond_timedwait 3 , -.Xr pthread_cond_wait 3 +.Xr pthread_cond_wait 3 , +.Xr pthread_condattr 3 .Sh STANDARDS The .Fn pthread_cond_init function conforms to .St -p1003.1-96 . Index: head/share/man/man3/pthread_mutex_init.3 =================================================================== --- head/share/man/man3/pthread_mutex_init.3 (revision 276260) +++ head/share/man/man3/pthread_mutex_init.3 (revision 276261) @@ -1,78 +1,78 @@ .\" Copyright (c) 1997 Brian Cully .\" 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. .\" 3. Neither the name of the author nor the names of any co-contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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 REGENTS 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. .\" .\" $FreeBSD$ .\" .Dd November 4, 2006 .Dt PTHREAD_MUTEX_INIT 3 .Os .Sh NAME .Nm pthread_mutex_init .Nd create a mutex .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_mutex_init "pthread_mutex_t *mutex" "const pthread_mutexattr_t *attr" .Sh DESCRIPTION The .Fn pthread_mutex_init function creates a new mutex, with attributes specified with .Fa attr . If .Fa attr is NULL the default attributes are used. .Sh RETURN VALUES If successful, .Fn pthread_mutex_init will return zero and put the new mutex id into .Fa mutex , otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_mutex_init function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr is invalid. .It Bq Er ENOMEM The process cannot allocate enough memory to create another mutex. .El .Sh SEE ALSO -.Xr pthread_mutexattr 3 , .Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_lock 3 , .Xr pthread_mutex_trylock 3 , -.Xr pthread_mutex_unlock 3 +.Xr pthread_mutex_unlock 3 , +.Xr pthread_mutexattr 3 .Sh STANDARDS The .Fn pthread_mutex_init function conforms to .St -p1003.1-96 . Index: head/share/man/man3/pthread_mutexattr_getkind_np.3 =================================================================== --- head/share/man/man3/pthread_mutexattr_getkind_np.3 (revision 276260) +++ head/share/man/man3/pthread_mutexattr_getkind_np.3 (revision 276261) @@ -1,81 +1,81 @@ .\" Copyright (c) 2003 Alexey Zelkin .\" 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. .\" .\" $FreeBSD$ .\" .Dd February 13, 2003 .Dt PTHREAD_MUTEXATTR_GETKIND_NP 3 .Os .Sh NAME .Nm pthread_mutexattr_getkind_np , .Nm pthread_mutexattr_setkind_np .Nd mutex attribute operations (legacy) .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread_np.h .Ft int .Fn pthread_mutexattr_getkind_np "pthread_mutexattr_t attr" .Ft int .Fn pthread_mutexattr_setkind_np "pthread_mutexattr_t *attr" "int kind" .Sh DESCRIPTION .Bf -symbolic These functions are deprecated and non-portable implementation of the mutex type manipulation. .Ef .Pp It is recommended to use the .Xr pthread_mutexattr_gettype 3 and .Xr pthread_mutexattr_settype 3 functions instead. .Sh RETURN VALUES The .Fn pthread_mutexattr_getkind_np function returns a positive value representing the .Dq kind of the mutex attribute .Fa attr if successful; otherwise the value \-1 is returned and the global variable .Va errno is set to indicate the error. .Pp .Rv -std pthread_mutexattr_setkind_np .Sh ERRORS The .Fn pthread_mutexattr_getkind_np and .Fn pthread_mutexattr_setkind_np functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr is invalid. .El .Sh SEE ALSO -.Xr pthread_mutexattr_gettype 3 , -.Xr pthread_mutexattr_settype 3 , .Xr pthread_mutex_destroy 3 , -.Xr pthread_mutex_init 3 +.Xr pthread_mutex_init 3 , +.Xr pthread_mutexattr_gettype 3 , +.Xr pthread_mutexattr_settype 3 Index: head/share/man/man3/pthread_rwlock_init.3 =================================================================== --- head/share/man/man3/pthread_rwlock_init.3 (revision 276260) +++ head/share/man/man3/pthread_rwlock_init.3 (revision 276261) @@ -1,102 +1,102 @@ .\" Copyright (c) 1998 Alex Nash .\" 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. .\" .\" $FreeBSD$ .\" .Dd August 4, 1998 .Dt PTHREAD_RWLOCK_INIT 3 .Os .Sh NAME .Nm pthread_rwlock_init .Nd initialize a read/write lock .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_rwlock_init "pthread_rwlock_t *lock" "const pthread_rwlockattr_t *attr" .Sh DESCRIPTION The .Fn pthread_rwlock_init function is used to initialize a read/write lock, with attributes specified by .Fa attr . If .Fa attr is NULL, the default read/write lock attributes are used. .Pp The results of calling .Fn pthread_rwlock_init with an already initialized lock are undefined. .Sh RETURN VALUES If successful, the .Fn pthread_rwlock_init function will return zero. Otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_rwlock_init function will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The system lacked the necessary resources (other than memory) to initialize the lock. .It Bq Er ENOMEM Insufficient memory exists to initialize the lock. .It Bq Er EPERM The caller does not have sufficient privilege to perform the operation. .El .Pp The .Fn pthread_rwlock_init function may fail if: .Bl -tag -width Er .It Bq Er EBUSY The system has detected an attempt to re-initialize the object referenced by .Fa lock , a previously initialized but not yet destroyed read/write lock. .It Bq Er EINVAL The value specified by .Fa attr is invalid. .El .Sh SEE ALSO +.Xr pthread_rwlock_destroy 3 , .Xr pthread_rwlockattr_init 3 , -.Xr pthread_rwlockattr_setpshared 3 , -.Xr pthread_rwlock_destroy 3 +.Xr pthread_rwlockattr_setpshared 3 .Sh STANDARDS The .Fn pthread_rwlock_init function is expected to conform to .St -susv2 . .Sh HISTORY The .Fn pthread_rwlock_init function first appeared in .Fx 3.0 . .Sh BUGS The PTHREAD_PROCESS_SHARED attribute is not supported. Index: head/share/man/man3/pthread_rwlockattr_getpshared.3 =================================================================== --- head/share/man/man3/pthread_rwlockattr_getpshared.3 (revision 276260) +++ head/share/man/man3/pthread_rwlockattr_getpshared.3 (revision 276261) @@ -1,86 +1,86 @@ .\" Copyright (c) 1998 Alex Nash .\" 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. .\" .\" $FreeBSD$ .\" .Dd March 22, 1999 .Dt PTHREAD_RWLOCKATTR_GETPSHARED 3 .Os .Sh NAME .Nm pthread_rwlockattr_getpshared .Nd get the process shared attribute .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *attr" "int *pshared" .Sh DESCRIPTION The .Fn pthread_rwlockattr_getpshared function is used to get the process shared setting of a read/write lock attribute object. The setting is returned via .Fa pshared , and may be one of two values: .Bl -tag -width PTHREAD_PROCESS_PRIVATE .It Dv PTHREAD_PROCESS_SHARED Any thread of any process that has access to the memory where the read/write lock resides can manipulate the lock. .It Dv PTHREAD_PROCESS_PRIVATE Only threads created within the same process as the thread that initialized the read/write lock can manipulate the lock. This is the default value. .El .Sh RETURN VALUES If successful, the .Fn pthread_rwlockattr_getpshared function will return zero. Otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_rwlockattr_getpshared function may fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr is invalid. .El .Sh SEE ALSO +.Xr pthread_rwlock_init 3 , .Xr pthread_rwlockattr_init 3 , -.Xr pthread_rwlockattr_setpshared 3 , -.Xr pthread_rwlock_init 3 +.Xr pthread_rwlockattr_setpshared 3 .Sh STANDARDS The .Fn pthread_rwlockattr_getpshared function is expected to conform to .St -susv2 . .Sh HISTORY The .Fn pthread_rwlockattr_getpshared function first appeared in .Fx 3.0 . Index: head/share/man/man3/pthread_rwlockattr_init.3 =================================================================== --- head/share/man/man3/pthread_rwlockattr_init.3 (revision 276260) +++ head/share/man/man3/pthread_rwlockattr_init.3 (revision 276261) @@ -1,71 +1,71 @@ .\" Copyright (c) 1998 Alex Nash .\" 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. .\" .\" $FreeBSD$ .\" .Dd August 4, 1998 .Dt PTHREAD_RWLOCKATTR_INIT 3 .Os .Sh NAME .Nm pthread_rwlockattr_init .Nd initialize a read/write lock .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_rwlockattr_init "pthread_rwlockattr_t *attr" .Sh DESCRIPTION The .Fn pthread_rwlockattr_init function is used to initialize a read/write lock attributes object. .Sh RETURN VALUES If successful, the .Fn pthread_rwlockattr_init function will return zero. Otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_rwlockattr_init function will fail if: .Bl -tag -width Er .It Bq Er ENOMEM Insufficient memory exists to initialize the attribute object. .El .Sh SEE ALSO +.Xr pthread_rwlock_init 3 , .Xr pthread_rwlockattr_destroy 3 , .Xr pthread_rwlockattr_getpshared 3 , -.Xr pthread_rwlockattr_setpshared 3 , -.Xr pthread_rwlock_init 3 +.Xr pthread_rwlockattr_setpshared 3 .Sh STANDARDS The .Fn pthread_rwlockattr_init function is expected to conform to .St -susv2 . .Sh HISTORY The .Fn pthread_rwlockattr_init function first appeared in .Fx 3.0 . Index: head/share/man/man3/pthread_rwlockattr_setpshared.3 =================================================================== --- head/share/man/man3/pthread_rwlockattr_setpshared.3 (revision 276260) +++ head/share/man/man3/pthread_rwlockattr_setpshared.3 (revision 276261) @@ -1,94 +1,94 @@ .\" Copyright (c) 1998 Alex Nash .\" 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. .\" .\" $FreeBSD$ .\" .Dd August 4, 1998 .Dt PTHREAD_RWLOCKATTR_SETPSHARED 3 .Os .Sh NAME .Nm pthread_rwlockattr_setpshared .Nd set the process shared attribute .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_rwlockattr_setpshared "pthread_rwlockattr_t *attr" "int pshared" .Sh DESCRIPTION The .Fn pthread_rwlockattr_setpshared function sets the process shared attribute of .Fa attr to the value referenced by .Fa pshared . The .Fa pshared argument may be one of two values: .Bl -tag -width PTHREAD_PROCESS_PRIVATE .It Dv PTHREAD_PROCESS_SHARED Any thread of any process that has access to the memory where the read/write lock resides can manipulate the lock. .It Dv PTHREAD_PROCESS_PRIVATE Only threads created within the same process as the thread that initialized the read/write lock can manipulate the lock. This is the default value. .El .Sh RETURN VALUES If successful, the .Fn pthread_rwlockattr_setpshared function will return zero. Otherwise an error number will be returned to indicate the error. .Sh ERRORS The .Fn pthread_rwlockattr_setpshared function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr or .Fa pshared is invalid. .El .Sh SEE ALSO +.Xr pthread_rwlock_init 3 , .Xr pthread_rwlockattr_getpshared 3 , -.Xr pthread_rwlockattr_init 3 , -.Xr pthread_rwlock_init 3 +.Xr pthread_rwlockattr_init 3 .Sh STANDARDS The .Fn pthread_rwlockattr_setpshared function is expected to conform to .St -susv2 . .Sh HISTORY The .Fn pthread_rwlockattr_setpshared function first appeared in .Fx 3.0 . .Sh BUGS The .Dv PTHREAD_PROCESS_SHARED attribute is not supported.