*** /dev/null Sat Nov 23 01:38:59 2024
--- - Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,9502 ----
+ .rn '' }`
+ ''' $RCSfile$$Revision$$Date$
+ '''
+ ''' $Log$
+ '''
+ .de Sh
+ .br
+ .if t .Sp
+ .ne 5
+ .PP
+ \fB\\$1\fR
+ .PP
+ ..
+ .de Sp
+ .if t .sp .5v
+ .if n .sp
+ ..
+ .de Ip
+ .br
+ .ie \\n(.$>=3 .ne \\$3
+ .el .ne 3
+ .IP "\\$1" \\$2
+ ..
+ .de Vb
+ .ft CW
+ .nf
+ .ne \\$1
+ ..
+ .de Ve
+ .ft R
+
+ .fi
+ ..
+ '''
+ '''
+ ''' Set up \*(-- to give an unbreakable dash;
+ ''' string Tr holds user defined translation string.
+ ''' Bell System Logo is used as a dummy character.
+ '''
+ .tr \(*W-|\(bv\*(Tr
+ .ie n \{\
+ .ds -- \(*W-
+ .ds PI pi
+ .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+ .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+ .ds L" ""
+ .ds R" ""
+ ''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of
+ ''' \*(L" and \*(R", except that they are used on ".xx" lines,
+ ''' such as .IP and .SH, which do another additional levels of
+ ''' double-quote interpretation
+ .ds M" """
+ .ds S" """
+ .ds N" """""
+ .ds T" """""
+ .ds L' '
+ .ds R' '
+ .ds M' '
+ .ds S' '
+ .ds N' '
+ .ds T' '
+ 'br\}
+ .el\{\
+ .ds -- \(em\|
+ .tr \*(Tr
+ .ds L" ``
+ .ds R" ''
+ .ds M" ``
+ .ds S" ''
+ .ds N" ``
+ .ds T" ''
+ .ds L' `
+ .ds R' '
+ .ds M' `
+ .ds S' '
+ .ds N' `
+ .ds T' '
+ .ds PI \(*p
+ 'br\}
+ .\" If the F register is turned on, we'll generate
+ .\" index entries out stderr for the following things:
+ .\" TH Title
+ .\" SH Header
+ .\" Sh Subsection
+ .\" Ip Item
+ .\" X<> Xref (embedded
+ .\" Of course, you have to process the output yourself
+ .\" in some meaninful fashion.
+ .if \nF \{
+ .de IX
+ .tm Index:\\$1\t\\n%\t"\\$2"
+ ..
+ .nr % 0
+ .rr F
+ .\}
+ .TH pthread 3 "01-Jul-2000" "GNU Pth 1.4a2" "POSIX Threading API of GNU Pth"
+ .UC
+ .if n .hy 0
+ .if n .na
+ .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+ .de CQ \" put $1 in typewriter font
+ .ft CW
+ 'if n "\c
+ 'if t \\&\\$1\c
+ 'if n \\&\\$1\c
+ 'if n \&"
+ \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
+ '.ft R
+ ..
+ .\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
+ . \" AM - accent mark definitions
+ .bd B 3
+ . \" fudge factors for nroff and troff
+ .if n \{\
+ . ds #H 0
+ . ds #V .8m
+ . ds #F .3m
+ . ds #[ \f1
+ . ds #] \fP
+ .\}
+ .if t \{\
+ . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+ . ds #V .6m
+ . ds #F 0
+ . ds #[ \&
+ . ds #] \&
+ .\}
+ . \" simple accents for nroff and troff
+ .if n \{\
+ . ds ' \&
+ . ds ` \&
+ . ds ^ \&
+ . ds , \&
+ . ds ~ ~
+ . ds ? ?
+ . ds ! !
+ . ds /
+ . ds q
+ .\}
+ .if t \{\
+ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+ . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+ . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+ . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+ . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+ . ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
+ . ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
+ . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+ . ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
+ .\}
+ . \" troff and (daisy-wheel) nroff accents
+ .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+ .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+ .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
+ .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
+ .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
+ .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
+ .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+ .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+ .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+ .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+ .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+ .ds ae a\h'-(\w'a'u*4/10)'e
+ .ds Ae A\h'-(\w'A'u*4/10)'E
+ .ds oe o\h'-(\w'o'u*4/10)'e
+ .ds Oe O\h'-(\w'O'u*4/10)'E
+ . \" corrections for vroff
+ .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+ .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+ . \" for low resolution devices (crt and lpr)
+ .if \n(.H>23 .if \n(.V>19 \
+ \{\
+ . ds : e
+ . ds 8 ss
+ . ds v \h'-1'\o'\(aa\(ga'
+ . ds _ \h'-1'^
+ . ds . \h'-1'.
+ . ds 3 3
+ . ds o a
+ . ds d- d\h'-1'\(ga
+ . ds D- D\h'-1'\(hy
+ . ds th \o'bp'
+ . ds Th \o'LP'
+ . ds ae ae
+ . ds Ae AE
+ . ds oe oe
+ . ds Oe OE
+ .\}
+ .rm #[ #] #H #V #F C
+ .SH "NAME"
+ \fBpthread\fR \- POSIX.1c Threading API of GNU Pth
+ .SH "VERSION"
+ GNU Pth 1.4a2 (01-Jul-2000)
+ .SH "SYNOPSIS"
+ \fBApplication Makefiles:\fR
+ .PP
+ .Vb 4
+ \& # manually
+ \& CFLAGS=-I/path/to/pth/include
+ \& LDFLAGS=-L/path/to/pth/lib
+ \& LIBS=-lpthread
+ .Ve
+ .Vb 4
+ \& # automatically
+ \& CFLAGS=`pthread-config --cflags`
+ \& LDFLAGS=`pthread-config --ldflags`
+ \& LIBS=`pthread-config --libs`
+ .Ve
+ \fBApplication source files:\fR
+ .PP
+ .Vb 1
+ \& #include <pthread.h>
+ .Ve
+ .SH "DESCRIPTION"
+ .Sh "Overview"
+ This is the \s-1IEEE\s0 Std. 1003.1c ("\s-1POSIX\s0.1c") conforming threading \s-1API\s0 of
+ \s-1GNU\s0 Portable Threads (\fBPth\fR). This \s-1API\s0 is commonly known as ``\fI\s-1POSIX\s0
+ threads\fR'\*(R' or in short ``\fIPthreads\fR'\*(R'. It is provided by \fBPth\fR with
+ the intention of backward compatibility to existing multithreaded
+ applications. It is implemented by mapping the various Pthread \s-1API\s0
+ functions to the corresponding native \fBPth\fR \s-1API\s0 functions.
+ .Sh "Supported Features"
+ The following defined feature macros in \f(CWpthread.h\fR indicate supported
+ features:
+ .PP
+ .Vb 3
+ \& #define _POSIX_THREADS
+ \& #define _POSIX_THREAD_ATTR_STACKADDR
+ \& #define _POSIX_THREAD_ATTR_STACKSIZE
+ .Ve
+ The following undefined feature macros in \f(CWpthread.h\fR indicate (still)
+ unsupported features:
+ .PP
+ .Vb 5
+ \& #undef _POSIX_THREAD_PRIORITY_SCHEDULING
+ \& #undef _POSIX_THREAD_PRIO_INHERIT
+ \& #undef _POSIX_THREAD_PRIO_PROTECT
+ \& #undef _POSIX_THREAD_PROCESS_SHARED
+ \& #undef _POSIX_THREAD_SAFE_FUNCTIONS
+ .Ve
+ .Sh "Notes"
+ A few notes which you should keep in mind when working with the \fBPth\fR Pthread
+ \s-1API\s0.
+ .Ip "\fBNon-Preemptive Scheduling\fR" 4
+ First you have to always remember when working with this Pthread library that
+ it uses non-preemptive scheduling, because it is directly based on \fBPth\fR
+ (\fBPth\fR for portability reasons is a pure non-preemptive thread scheduling
+ system). So there is no implicit yielding of execution control unless you can
+ \f(CWpthread_*\fR functions which could block and you cannot expect granular
+ concurrency in your application, of course. Nevertheless the responsiveness
+ and concurrency of an event driven application is increased greatly because of
+ overlapping I/O.
+ .Ip "\fBConflicts with Vendor Implementation\fR" 4
+ There can be a conflict between the \fBPth\fR \f(CWpthread.h\fR header and a possibly
+ existing vendor \f(CW/usr/include/pthread.h\fR header which was implicitly included
+ by some standard vendor headers (like \f(CW/usr/include/unistd.h\fR). When this
+ occurs try to ``\f(CW#define\fR'\*(R' header-dependent values which prevent the
+ inclusion of the vendor header.
+ .Sh "Further Reading"
+ There is ``\fIThe Single \s-1UNIX\s0 Specification, Version
+ 2 \- Threads\fR'\*(R', from \fIThe Open Group\fR of 1997 under
+ http://www.opengroup.org/onlinepubs/007908799/xsh/threads.html. This is
+ a very complete publically available description of the Pthread \s-1API\s0. For
+ convinience reasons, a translated copy of these freely available \s-1HTML\s0
+ pages are appended to this manpage below. These are \fICopyright (C) 1997
+ The Open Group\fR.
+ .PP
+ Second, you can also buy the official standard from \s-1IEEE\s0. It is the \s-1IEEE\s0
+ \s-1POSIX\s0 1003.1c-1995 standard (also known as \s-1ISO/IEC\s0 9945-1:1996), which
+ is available as part of the \s-1ANSI/IEEE\s0 1003.1, 1996 edition, standard.
+ .PP
+ Finally you can look at the files \f(CWpthread.c\fR and \f(CWpthread.h\fR in the \fBPth\fR
+ source tree for details of the implementation, of course.
+ .SH "SEE ALSO"
+ pthread-\fIconfig\fR\|(1), \fIpth\fR\|(3).
+ .SH "AUTHOR"
+ .PP
+ .Vb 3
+ \& Ralf S. Engelschall
+ \& rse@engelschall.com
+ \& www.engelschall.com
+ .Ve
+ ##
+ ## The Single UNIX Specification, Version 2 \- Threads
+ ## http://www.opengroup.org/onlinepubs/007908799/xsh/threads.html
+ ## Copyright (C) 1997 The Open Group, All Rights Reserved.
+ ##
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread.h\fR \- threads
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .SH "DESCRIPTION"
+ The
+ \fI<pthread.h\fR>
+ header defines the following symbols:
+ .PP
+ .Vb 24
+ \& PTHREAD_CANCEL_ASYNCHRONOUS
+ \& PTHREAD_CANCEL_ENABLE
+ \& PTHREAD_CANCEL_DEFERRED
+ \& PTHREAD_CANCEL_DISABLE
+ \& PTHREAD_CANCELED
+ \& PTHREAD_COND_INITIALIZER
+ \& PTHREAD_CREATE_DETACHED
+ \& PTHREAD_CREATE_JOINABLE
+ \& PTHREAD_EXPLICIT_SCHED
+ \& PTHREAD_INHERIT_SCHED
+ \& PTHREAD_MUTEX_DEFAULT
+ \& PTHREAD_MUTEX_ERRORCHECK
+ \& PTHREAD_MUTEX_NORMAL
+ \& PTHREAD_MUTEX_INITIALIZER
+ \& PTHREAD_MUTEX_RECURSIVE
+ \& PTHREAD_ONCE_INIT
+ \& PTHREAD_PRIO_INHERIT
+ \& PTHREAD_PRIO_NONE
+ \& PTHREAD_PRIO_PROTECT
+ \& PTHREAD_PROCESS_SHARED
+ \& PTHREAD_PROCESS_PRIVATE
+ \& PTHREAD_RWLOCK_INITIALIZER
+ \& PTHREAD_SCOPE_PROCESS
+ \& PTHREAD_SCOPE_SYSTEM
+ .Ve
+ The \fBpthread_attr_t\fR, \fBpthread_cond_t\fR, \fBpthread_condattr_t\fR,
+ \fBpthread_key_t\fR, \fBpthread_mutex_t\fR, \fBpthread_mutexattr_t\fR,
+ \fBpthread_once_t\fR, \fBpthread_rwlock_t\fR, \fBpthread_rwlockattr_t\fR and
+ \fBpthread_t\fR types are defined as described in \fI<sys/types.h\fR>.
+ .PP
+ The following are declared as functions and may also be declared as
+ macros. Function prototypes must be provided for use with an ISO C
+ compiler.
+ .PP
+ .Vb 77
+ \& int pthread_attr_destroy(pthread_attr_t *);
+ \& int pthread_attr_getdetachstate(const pthread_attr_t *, int *);
+ \& int pthread_attr_getguardsize(const pthread_attr_t *, size_t *);
+ \& int pthread_attr_getinheritsched(const pthread_attr_t *, int *);
+ \& int pthread_attr_getschedparam(const pthread_attr_t *, struct sched_param *);
+ \& int pthread_attr_getschedpolicy(const pthread_attr_t *, int *);
+ \& int pthread_attr_getscope(const pthread_attr_t *, int *);
+ \& int pthread_attr_getstackaddr(const pthread_attr_t *, void **);
+ \& int pthread_attr_getstacksize(const pthread_attr_t *, size_t *);
+ \& int pthread_attr_init(pthread_attr_t *);
+ \& int pthread_attr_setdetachstate(pthread_attr_t *, int);
+ \& int pthread_attr_setguardsize(pthread_attr_t *, size_t);
+ \& int pthread_attr_setinheritsched(pthread_attr_t *, int);
+ \& int pthread_attr_setschedparam(pthread_attr_t *, const struct sched_param *);
+ \& int pthread_attr_setschedpolicy(pthread_attr_t *, int);
+ \& int pthread_attr_setscope(pthread_attr_t *, int);
+ \& int pthread_attr_setstackaddr(pthread_attr_t *, void *);
+ \& int pthread_attr_setstacksize(pthread_attr_t *, size_t);
+ \& int pthread_cancel(pthread_t);
+ \& void pthread_cleanup_push(void*), void *);
+ \& void pthread_cleanup_pop(int);
+ \& int pthread_cond_broadcast(pthread_cond_t *);
+ \& int pthread_cond_destroy(pthread_cond_t *);
+ \& int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
+ \& int pthread_cond_signal(pthread_cond_t *);
+ \& int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *, const struct timespec *);
+ \& int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *);
+ \& int pthread_condattr_destroy(pthread_condattr_t *);
+ \& int pthread_condattr_getpshared(const pthread_condattr_t *, int *);
+ \& int pthread_condattr_init(pthread_condattr_t *);
+ \& int pthread_condattr_setpshared(pthread_condattr_t *, int);
+ \& int pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *), void *);
+ \& int pthread_detach(pthread_t);
+ \& int pthread_equal(pthread_t, pthread_t);
+ \& void pthread_exit(void *);
+ \& int pthread_getconcurrency(void);
+ \& int pthread_getschedparam(pthread_t, int *, struct sched_param *);
+ \& void *pthread_getspecific(pthread_key_t);
+ \& int pthread_join(pthread_t, void **);
+ \& int pthread_key_create(pthread_key_t *, void (*)(void *));
+ \& int pthread_key_delete(pthread_key_t);
+ \& int pthread_mutex_destroy(pthread_mutex_t *);
+ \& int pthread_mutex_getprioceiling(const pthread_mutex_t *, int *);
+ \& int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *);
+ \& int pthread_mutex_lock(pthread_mutex_t *);
+ \& int pthread_mutex_setprioceiling(pthread_mutex_t *, int, int *);
+ \& int pthread_mutex_trylock(pthread_mutex_t *);
+ \& int pthread_mutex_unlock(pthread_mutex_t *);
+ \& int pthread_mutexattr_destroy(pthread_mutexattr_t *);
+ \& int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *, int *);
+ \& int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *, int *);
+ \& int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, int *);
+ \& int pthread_mutexattr_gettype(const pthread_mutexattr_t *, int *);
+ \& int pthread_mutexattr_init(pthread_mutexattr_t *);
+ \& int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
+ \& int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
+ \& int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
+ \& int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
+ \& int pthread_once(pthread_once_t *, void (*)(void));
+ \& int pthread_rwlock_destroy(pthread_rwlock_t *);
+ \& int pthread_rwlock_init(pthread_rwlock_t *, const pthread_rwlockattr_t *);
+ \& int pthread_rwlock_rdlock(pthread_rwlock_t *);
+ \& int pthread_rwlock_tryrdlock(pthread_rwlock_t *);
+ \& int pthread_rwlock_trywrlock(pthread_rwlock_t *);
+ \& int pthread_rwlock_unlock(pthread_rwlock_t *);
+ \& int pthread_rwlock_wrlock(pthread_rwlock_t *);
+ \& int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
+ \& int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *, int *);
+ \& int pthread_rwlockattr_init(pthread_rwlockattr_t *);
+ \& int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
+ \& pthread_t pthread_self(void);
+ \& int pthread_setcancelstate(int, int *);
+ \& int pthread_setcanceltype(int, int *);
+ \& int pthread_setconcurrency(int);
+ \& int pthread_setschedparam(pthread_t, int, const struct sched_param *);
+ \& int pthread_setspecific(pthread_key_t, const void *);
+ \& void pthread_testcancel(void);
+ .Ve
+ Inclusion of the \fI<pthread.h\fR> header will make visible symbols defined
+ in the headers \fI<sched.h\fR> and \fI<time.h\fR>.
+ .SH "APPLICATION USAGE"
+ An interpretation request has been filed with IEEE PASC concerning
+ requirements for visibility of symbols in this header.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_getguardsize()\fR,
+ \fIpthread_attr_setscope()\fR,
+ \fIpthread_cancel()\fR,
+ \fIpthread_cleanup_push()\fR,
+ \fIpthread_cond_init()\fR,
+ \fIpthread_cond_signal()\fR,
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_condattr_init()\fR,
+ \fIpthread_create()\fR,
+ \fIpthread_detach()\fR,
+ \fIpthread_equal()\fR,
+ \fIpthread_exit()\fR,
+ \fIpthread_getconcurrency()\fR,
+ \fIpthread_getschedparam()\fR,
+ \fIpthread_join()\fR,
+ \fIpthread_key_create()\fR,
+ \fIpthread_key_delete()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_setprioceiling()\fR,
+ \fIpthread_mutexattr_init()\fR,
+ \fIpthread_mutexattr_gettype()\fR,
+ \fIpthread_mutexattr_setprotocol()\fR,
+ \fIpthread_once()\fR,
+ \fIpthread_self()\fR,
+ \fIpthread_setcancelstate()\fR,
+ \fIpthread_setspecific()\fR,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_rdlock()\fR,
+ \fIpthread_rwlock_unlock()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fI<sched.h\fR>,
+ \fI<time.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_atfork\fR \- register fork handlers
+ .SH "SYNOPSIS"
+ #include <sys/types.h>
+ .PP
+ #include <unistd.h>
+ .PP
+ int \fIpthread_atfork\fR\|(void (*\fIprepare\fR)(void), void (*\fIparent\fR)(void),
+ void (*\fIchild\fR)(void));
+ .SH "DESCRIPTION"
+ The \fIpthread_atfork()\fR function declares fork handlers to be called
+ before and after \fIfork()\fR, in the context of the thread that called
+ \fIfork()\fR. The \fIprepare\fR fork handler is called before \fIfork()\fR
+ processing commences. The \fIparent\fR fork handle is called after
+ \fIfork()\fR processing completes in the parent process. The \fIchild\fR fork
+ handler is called after \fIfork()\fR processing completes in the child
+ process. If no handling is desired at one or more of these three points,
+ the corresponding fork handler \fIaddress\fR\|(es) may be set to NULL.
+ .PP
+ The order of calls to \fIpthread_atfork()\fR is significant. The \fIparent\fR
+ and \fIchild\fR fork handlers are called in the order in which they were
+ established by calls to \fIpthread_atfork()\fR. The \fIprepare\fR fork
+ handlers are called in the opposite order.
+ .SH "RETURN VALUE"
+ Upon successful completion, \fIpthread_atfork()\fR returns a value of zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The \fIpthread_atfork()\fR function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient table space exists to record the fork handler addresses.
+ .PP
+ The \fIpthread_atfork()\fR function will not return an error code of
+ [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIatexit()\fR,
+ \fIfork()\fR,
+ \fI<sys/types.h\fR>
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_init,\fR \fBpthread_attr_destroy\fR
+ \- initialise and destroy threads attribute object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_init\fR\|(pthread_attr_t *\fIattr\fR);
+ .PP
+ int \fIpthread_attr_destroy\fR\|(pthread_attr_t *\fIattr\fR);
+ .SH "DESCRIPTION"
+ The function \fIpthread_attr_init()\fR initialises a thread attributes
+ object \fIattr\fR with the default value for all of the individual
+ attributes used by a given implementation.
+ .PP
+ The resulting attribute object (possibly modified by setting individual
+ attribute values), when used by \fIpthread_create()\fR, defines the
+ attributes of the thread created. A single attributes object can be used
+ in multiple simultaneous calls to \fIpthread_create()\fR.
+ .PP
+ The \fIpthread_attr_destroy()\fR function is used to destroy a thread
+ attributes object. An implementation may cause \fIpthread_attr_destroy()\fR
+ to set \fIattr\fR to an implementation-dependent invalid value. The
+ behaviour of using the attribute after it has been destroyed is
+ undefined.
+ .SH "RETURN VALUE"
+ Upon successful completion, \fIpthread_attr_init()\fR and
+ \fIpthread_attr_destroy()\fR return a value of 0. Otherwise, an error
+ number is returned to indicate the error.
+ .SH "ERRORS"
+ The \fIpthread_attr_init()\fR function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the thread attributes object.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_setstackaddr()\fR,
+ \fIpthread_attr_setstacksize()\fR,
+ \fIpthread_attr_setdetachstate()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setdetachstate,\fR \fBpthread_attr_getdetachstate\fR
+ \- set and get detachstate attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setdetachstate\fR\|(pthread_attr_t *\fIattr\fR, int \fIdetachstate\fR);
+ .PP
+ int \fIpthread_attr_getdetachstate\fR\|(const pthread_attr_t *\fIattr\fR, int *\fIdetachstate\fR);
+ .SH "DESCRIPTION"
+ The \fIdetachstate\fR attribute controls whether the thread is created in a
+ detached state. If the thread is created detached, then use of the ID of
+ the newly created thread by the \fIpthread_detach()\fR or \fIpthread_join()\fR
+ function is an error.
+ .PP
+ The \fIpthread_attr_setdetachstate()\fR and
+ \fIpthread_attr_getdetachstate()\fR, respectively, set and get the
+ \fIdetachstate\fR attribute in the \fIattr\fR object.
+ .PP
+ The \fIdetachstate\fR can be set to either PTHREAD_CREATE_DETACHED or
+ PTHREAD_CREATE_JOINABLE. A value of PTHREAD_CREATE_DETACHED causes
+ all threads created with \fIattr\fR to be in the detached state, whereas
+ using a value of PTHREAD_CREATE_JOINABLE causes all threads created
+ with \fIattr\fR to be in the joinable state. The default value of the
+ \fIdetachstate\fR attribute is PTHREAD_CREATE_JOINABLE .
+ .SH "RETURN VALUE"
+ Upon successful completion, \fIpthread_attr_setdetachstate()\fR and
+ \fIpthread_attr_getdetachstate()\fR return a value of 0. Otherwise, an
+ error number is returned to indicate the error.
+ .PP
+ The \fIpthread_attr_getdetachstate()\fR function stores the value of the
+ \fIdetachstate\fR attribute in \fIdetachstate\fR if successful.
+ .SH "ERRORS"
+ The \fIpthread_attr_setdetachstate()\fR function will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of \fIdetachstate\fR was not valid
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setstackaddr()\fR,
+ \fIpthread_attr_setstacksize()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_getguardsize,\fR \fBpthread_attr_setguardsize\fR \-
+ get or set the thread guardsize attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_getguardsize\fR\|(const pthread_attr_t \fI*attr\fR, size_t
+ \fI*guardsize\fR); int \fIpthread_attr_setguardsize\fR\|(pthread_attr_t \fI*attr\fR,
+ size_t \fIguardsize\fR);
+ .SH "DESCRIPTION"
+ The \fIguardsize\fR attribute controls the size of the guard area for the
+ created thread's stack. The \fIguardsize\fR attribute provides protection
+ against overflow of the stack pointer. If a thread's stack is created
+ with guard protection, the implementation allocates extra memory at the
+ overflow end of the stack as a buffer against stack overflow of the
+ stack pointer. If an application overflows into this buffer an error
+ results (possibly in a SIGSEGV signal being delivered to the thread).
+ .PP
+ The \fIguardsize\fR attribute is provided to the application
+ for two reasons:
+ .Ip "1." 4
+ Overflow protection can potentially result in wasted system resources.
+ An application that creates a large number of threads, and which knows
+ its threads will never overflow their stack, can save system resources
+ by turning off guard areas.
+ .Ip "2." 4
+ When threads allocate large data structures on the stack,
+ large guard areas may be needed to detect stack overflow.
+ .PP
+ The \fIpthread_attr_getguardsize()\fR function gets the \fIguardsize\fR
+ attribute in the \fIattr\fR object. This attribute is returned in the
+ \fIguardsize\fR parameter.
+ .PP
+ The \fIpthread_attr_setguardsize()\fR function sets the \fIguardsize\fR
+ attribute in the \fIattr\fR object. The new value of this attribute is
+ obtained from the \fIguardsize\fR parameter. If \fIguardsize\fR is zero,
+ a guard area will not be provided for threads created with \fIattr\fR.
+ If \fIguardsize\fR is greater than zero, a guard area of at least size
+ \fIguardsize\fR bytes is provided for each thread created with \fIattr\fR.
+ .PP
+ A conforming implementation is permitted to round up the value
+ contained in \fIguardsize\fR to a multiple of the configurable system
+ variable \s-1PAGESIZE\s0 (see \fI<sys/mman.h\fR>). If an implementation rounds
+ up the value of \fIguardsize\fR to a multiple of \s-1PAGESIZE\s0, a call to
+ \fIpthread_attr_getguardsize()\fR specifying \fIattr\fR will store in the
+ \fIguardsize\fR parameter the guard size specified by the previous
+ \fIpthread_attr_setguardsize()\fR function call.
+ .PP
+ The default value of the \fIguardsize\fR attribute is \s-1PAGESIZE\s0 bytes. The
+ actual value of \s-1PAGESIZE\s0 is implementation-dependent and may not be the
+ same on all implementations.
+ .PP
+ If the \fIstackaddr\fR attribute has been set (that is, the caller is
+ allocating and managing its own thread stacks), the \fIguardsize\fR
+ attribute is ignored and no protection will be provided by the
+ implementation. It is the responsibility of the application to manage
+ stack overflow along with stack allocation and management in this case.
+ .SH "RETURN VALUE"
+ If successful, the \fIpthread_attr_getguardsize()\fR and
+ \fIpthread_attr_setguardsize()\fR functions return zero. Otherwise, an
+ error number is returned to indicate the error.
+ .SH "ERRORS"
+ The \fIpthread_attr_getguardsize()\fR and \fIpthread_attr_setguardsize()\fR
+ functions will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The attribute \fIattr\fR is invalid.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The parameter \fIguardsize\fR is invalid.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The parameter \fIguardsize\fR contains an invalid value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setinheritsched,\fR \fBpthread_attr_getinheritsched\fR
+ \- set and get inheritsched attribute
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setinheritsched\fR\|(pthread_attr_t *\fIattr\fR,
+ int \fIinheritsched\fR);
+ int \fIpthread_attr_getinheritsched\fR\|(const pthread_attr_t *\fIattr\fR,
+ int *\fIinheritsched\fR);
+ .SH "DESCRIPTION"
+ The functions \fIpthread_attr_setinheritsched()\fR and
+ \fIpthread_attr_getinheritsched()\fR, respectively, set and get the
+ \fIinheritsched\fR attribute in the \fIattr\fR argument.
+ .PP
+ When the attribute objects are used by \fIpthread_create()\fR, the
+ \fIinheritsched\fR attribute determines how the other scheduling attributes
+ of the created thread are to be set:
+ .Ip "\s-1PTHREAD_INHERIT_SCHED\s0" 4
+ Specifies that the scheduling policy and associated attributes are to
+ be inherited from the creating thread, and the scheduling attributes in
+ this \fIattr\fR argument are to be ignored.
+ .Ip "\s-1PTHREAD_EXPLICIT_SCHED\s0" 4
+ Specifies that the scheduling policy and associated attributes
+ are to be set to the corresponding values from this attribute object.
+ .PP
+ The symbols \s-1PTHREAD_INHERIT_SCHED\s0 and \s-1PTHREAD_EXPLICIT_SCHED\s0 are defined
+ in the header \fI<pthread.h\fR>.
+ .SH "RETURN VALUE"
+ If successful, the \fIpthread_attr_setinheritsched()\fR and
+ \fIpthread_attr_getinheritsched()\fR functions return zero. Otherwise, an
+ error number is returned to indicate the error.
+ .SH "ERRORS"
+ The \fIpthread_attr_setinheritsched()\fR and
+ \fIpthread_attr_getinheritsched()\fR functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_attr_setinheritsched()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with the
+ specified attributes using \fIpthread_create()\fR. Using these routines
+ does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setscope()\fR,
+ \fIpthread_attr_setschedpolicy()\fR,
+ \fIpthread_attr_setschedparam()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setschedparam,\fR \fBpthread_attr_getschedparam\fR
+ \- set and get schedparam attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setschedparam\fR\|(pthread_attr_t *\fIattr\fR, const struct sched_param *\fIparam\fR);
+ .PP
+ int \fIpthread_attr_getschedparam\fR\|(const pthread_attr_t *\fIattr\fR, struct sched_param *\fIparam\fR);
+ .SH "DESCRIPTION"
+ The functions \fIpthread_attr_setschedparam()\fR and
+ \fIpthread_attr_getschedparam()\fR, respectively, set and get the
+ scheduling parameter attributes in the \fIattr\fR argument. The contents of
+ the \fIparam\fR structure are defined in \fI<sched.h\fR>. For the SCHED_FIFO
+ and SCHED_RR policies, the only required member of \fIparam\fR is
+ \fIsched_priority\fR.
+ .SH "RETURN VALUE"
+ If successful, the \fIpthread_attr_setschedparam()\fR and
+ \fIpthread_attr_getschedparam()\fR functions return zero. Otherwise, an
+ error number is returned to indicate the error.
+ .SH "ERRORS"
+ The \fIpthread_attr_setschedparam()\fR function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .PP
+ The
+ \fIpthread_attr_setschedparam()\fR
+ and
+ \fIpthread_attr_getschedparam()\fR
+ functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with the
+ specified attributes using \fIpthread_create()\fR. Using these routines
+ does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setscope()\fR,
+ \fIpthread_attr_setinheritsched()\fR,
+ \fIpthread_attr_setschedpolicy()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setschedpolicy,\fR \fBpthread_attr_getschedpolicy\fR
+ \- set and get schedpolicy attribute
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setschedpolicy\fR\|(pthread_attr_t *\fIattr\fR, int \fIpolicy\fR);
+ int \fIpthread_attr_getschedpolicy\fR\|(const pthread_attr_t *\fIattr\fR,
+ int *\fIpolicy\fR);
+ .SH "DESCRIPTION"
+ The functions \fIpthread_attr_setschedpolicy()\fR and
+ \fIpthread_attr_getschedpolicy()\fR, respectively, set and get the
+ \fIschedpolicy\fR attribute in the \fIattr\fR argument.
+ .PP
+ The supported values of \fIpolicy\fR include SCHED_FIFO, SCHED_RR and
+ SCHED_OTHER, which are defined by the header \fI<sched.h\fR>. When threads
+ executing with the scheduling policy SCHED_FIFO or SCHED_RR are waiting
+ on a mutex, they acquire the mutex in priority order when the mutex is
+ unlocked.
+ .SH "RETURN VALUE"
+ If successful, the \fIpthread_attr_setschedpolicy()\fR and
+ \fIpthread_attr_getschedpolicy()\fR functions return zero. Otherwise, an
+ error number is returned to indicate the error.
+ .SH "ERRORS"
+ The \fIpthread_attr_setschedpolicy()\fR and
+ \fIpthread_attr_getschedpolicy()\fR functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The \fIpthread_attr_setschedpolicy()\fR function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with the
+ specified attributes using \fIpthread_create()\fR. Using these routines
+ does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setscope()\fR,
+ \fIpthread_attr_setinheritsched()\fR,
+ \fIpthread_attr_setschedparam()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setscope,\fR \fBpthread_attr_getscope\fR
+ \- set and get contentionscope attribute
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setscope\fR\|(pthread_attr_t *\fIattr\fR, int \fIcontentionscope\fR);
+ int \fIpthread_attr_getscope\fR\|(const pthread_attr_t *\fIattr\fR,
+ int *\fIcontentionscope\fR);
+ .SH "DESCRIPTION"
+ The \fIpthread_attr_setscope()\fR and \fIpthread_attr_getscope()\fR functions
+ are used to set and get the \fIcontentionscope\fR attribute in the \fIattr\fR
+ object.
+ .PP
+ The \fIcontentionscope\fR attribute may have the values
+ PTHREAD_SCOPE_SYSTEM, signifying system scheduling contention scope, or
+ PTHREAD_SCOPE_PROCESS, signifying process scheduling contention scope.
+ The symbols PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS are defined
+ by the header \fI<pthread.h\fR>.
+ .SH "RETURN VALUE"
+ If successful, the \fIpthread_attr_setscope()\fR and
+ \fIpthread_attr_getscope()\fR functions return zero. Otherwise, an error
+ number is returned to indicate the error.
+ .SH "ERRORS"
+ The \fIpthread_attr_setscope()\fR and \fIpthread_attr_getscope()\fR functions
+ will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_attr_setscope()\fR,
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with the
+ specified attributes using \fIpthread_create()\fR. Using these routines
+ does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setinheritsched()\fR,
+ \fIpthread_attr_setschedpolicy()\fR,
+ \fIpthread_attr_setschedparam()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setstackaddr,\fR \fBpthread_attr_getstackaddr\fR
+ \- set and get stackaddr attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setstackaddr\fR\|(pthread_attr_t *\fIattr\fR, void *\fIstackaddr\fR);
+ .PP
+ int \fIpthread_attr_getstackaddr\fR\|(const pthread_attr_t *\fIattr\fR, void **\fIstackaddr\fR);
+ .SH "DESCRIPTION"
+ The functions \fIpthread_attr_setstackaddr()\fR and
+ \fIpthread_attr_getstackaddr()\fR, respectively, set and get the thread
+ creation \fIstackaddr\fR attribute in the \fIattr\fR object.
+ .PP
+ The \fIstackaddr\fR attribute specifies the location of storage to be used
+ for the created thread's stack. The size of the storage is at least
+ PTHREAD_STACK_MIN.
+ .SH "RETURN VALUE"
+ Upon successful completion, \fIpthread_attr_setstackaddr()\fR and
+ \fIpthread_attr_getstackaddr()\fR return a value of 0. Otherwise, an error
+ number is returned to indicate the error.
+ .PP
+ The \fIpthread_attr_getstackaddr()\fR function stores the \fIstackaddr\fR
+ attribute value in \fIstackaddr\fR if successful.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ These functions will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setdetachstate()\fR,
+ \fIpthread_attr_setstacksize()\fR,
+ \fIpthread_create()\fR,
+ \fI<limits.h\fR>,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setstacksize,\fR \fBpthread_attr_getstacksize\fR
+ \- set and get stacksize attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setstacksize\fR\|(pthread_attr_t *\fIattr\fR, size_t \fIstacksize\fR);
+ int \fIpthread_attr_getstacksize\fR\|(const pthread_attr_t *\fIattr\fR,
+ size_t *\fIstacksize\fR);
+ .SH "DESCRIPTION"
+ The functions
+ \fIpthread_attr_setstacksize()\fR
+ and
+ \fIpthread_attr_getstacksize()\fR,
+ respectively, set and get the thread creation
+ \fIstacksize\fR
+ attribute in the
+ \fIattr\fR
+ object.
+ .PP
+ The
+ \fIstacksize\fR
+ attribute defines the minimum stack size (in bytes) allocated for
+ the created threads stack.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_attr_setstacksize()\fR
+ and
+ \fIpthread_attr_getstacksize()\fR
+ return a value of 0.
+ Otherwise, an error number is returned to indicate the error.
+ The
+ \fIpthread_attr_getstacksize()\fR
+ function stores the
+ \fIstacksize\fR
+ attribute value in
+ \fIstacksize\fR
+ if successful.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_setstacksize()\fR
+ function will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of
+ \fIstacksize\fR
+ is less than \s-1PTHREAD_STACK_MIN\s0 or exceeds a system-imposed limit.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setstackaddr()\fR,
+ \fIpthread_attr_setdetachstate()\fR,
+ \fIpthread_create()\fR,
+ \fI<limits.h\fR>,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_init,\fR \fBpthread_attr_destroy\fR
+ \- initialise and destroy threads attribute object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_init\fR\|(pthread_attr_t *\fIattr\fR);
+ int \fIpthread_attr_destroy\fR\|(pthread_attr_t *\fIattr\fR);
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_attr_init()\fR
+ initialises a thread attributes object
+ \fIattr\fR
+ with the default value for all of the individual attributes
+ used by a given implementation.
+ .PP
+ The resulting attribute object
+ (possibly modified by setting individual attribute values),
+ when used by
+ \fIpthread_create()\fR,
+ defines the attributes of the thread created.
+ A single attributes object can be used in multiple simultaneous calls to
+ \fIpthread_create()\fR.
+ .PP
+ The
+ \fIpthread_attr_destroy()\fR
+ function is used to destroy a thread attributes object.
+ An implementation may cause
+ \fIpthread_attr_destroy()\fR
+ to set
+ \fIattr\fR
+ to an implementation-dependent invalid value.
+ The behaviour of using the attribute after it has been destroyed is undefined.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_attr_init()\fR
+ and
+ \fIpthread_attr_destroy()\fR
+ return a value of 0.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_init()\fR
+ function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the thread attributes object.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_setstackaddr()\fR,
+ \fIpthread_attr_setstacksize()\fR,
+ \fIpthread_attr_setdetachstate()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setdetachstate,\fR \fBpthread_attr_getdetachstate\fR
+ \- set and get detachstate attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setdetachstate\fR\|(pthread_attr_t *\fIattr\fR, int \fIdetachstate\fR);
+ int \fIpthread_attr_getdetachstate\fR\|(const pthread_attr_t *\fIattr\fR,
+ int *\fIdetachstate\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIdetachstate\fR
+ attribute controls whether the thread is created in a detached state.
+ If the thread is created detached,
+ then use of the ID of the newly created thread by the
+ \fIpthread_detach()\fR
+ or
+ \fIpthread_join()\fR
+ function is an error.
+ .PP
+ The
+ \fIpthread_attr_setdetachstate()\fR
+ and
+ \fIpthread_attr_getdetachstate()\fR,
+ respectively, set and get the
+ \fIdetachstate\fR
+ attribute in the
+ \fIattr\fR
+ object.
+ .PP
+ The
+ \fIdetachstate\fR
+ can be set to either PTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE.
+ A value of PTHREAD_CREATE_DETACHED causes all threads created with
+ \fIattr\fR
+ to be in the detached state, whereas using a value of
+ PTHREAD_CREATE_JOINABLE
+ causes all threads created with
+ \fIattr\fR
+ to be in the joinable state.
+ The default value of the
+ \fIdetachstate\fR
+ attribute is
+ PTHREAD_CREATE_JOINABLE .
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_attr_setdetachstate()\fR
+ and
+ \fIpthread_attr_getdetachstate()\fR
+ return a value of 0.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ The
+ \fIpthread_attr_getdetachstate()\fR
+ function stores the value of the
+ \fIdetachstate\fR
+ attribute in
+ \fIdetachstate\fR
+ if successful.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_setdetachstate()\fR
+ function will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of
+ \fIdetachstate\fR
+ was not valid
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setstackaddr()\fR,
+ \fIpthread_attr_setstacksize()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_getguardsize,\fR \fBpthread_attr_setguardsize\fR \-
+ get or set the thread guardsize attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_getguardsize\fR\|(const pthread_attr_t \fI*attr\fR,
+ size_t \fI*guardsize\fR);
+ int \fIpthread_attr_setguardsize\fR\|(pthread_attr_t \fI*attr\fR,
+ size_t \fIguardsize\fR);
+ .SH "DESCRIPTION"
+ The \fIguardsize\fR attribute controls the size
+ of the guard area for the created thread's stack. The \fIguardsize\fR
+ attribute provides protection against overflow of the
+ stack pointer. If a thread's stack is created with guard
+ protection, the implementation allocates extra
+ memory at the overflow end of the stack as a buffer against
+ stack overflow of the stack pointer. If an application
+ overflows into this buffer an error results (possibly
+ in a SIGSEGV signal being delivered to the thread).
+ .PP
+ The \fIguardsize\fR attribute is provided to the application
+ for two reasons:
+ .Ip "1." 4
+ Overflow protection can potentially
+ result in wasted system resources. An application that creates a large
+ number of threads, and which knows its threads will never overflow
+ their stack, can save system resources by turning off guard areas.
+ .Ip "2." 4
+ When threads allocate large data structures on the stack,
+ large guard areas may be needed to detect stack overflow.
+ .PP
+ The
+ \fIpthread_attr_getguardsize()\fR
+ function gets the
+ \fIguardsize\fR attribute in the \fIattr\fR object. This attribute is
+ returned in the \fIguardsize\fR parameter.
+ .PP
+ The
+ \fIpthread_attr_setguardsize()\fR
+ function sets the
+ \fIguardsize\fR attribute in the \fIattr\fR object. The new value of
+ this attribute is obtained from the \fIguardsize\fR parameter.
+ If \fIguardsize\fR is zero, a guard area will not be
+ provided for threads created with \fIattr\fR. If \fIguardsize\fR is
+ greater
+ than zero, a guard area of at least size \fIguardsize\fR
+ bytes is provided for each thread created with \fIattr\fR.
+ .PP
+ A conforming implementation is permitted to round up
+ the value contained in \fIguardsize\fR to a multiple
+ of the configurable system variable \s-1PAGESIZE\s0 (see
+ \fI<sys/mman.h\fR>).
+ If an implementation rounds up the
+ value of \fIguardsize\fR to a multiple of \s-1PAGESIZE\s0, a call to
+ \fIpthread_attr_getguardsize()\fR
+ specifying \fIattr\fR will
+ store in the \fIguardsize\fR parameter the guard size specified by the
+ previous
+ \fIpthread_attr_setguardsize()\fR
+ function call.
+ .PP
+ The default value of the \fIguardsize\fR attribute is \s-1PAGESIZE\s0 bytes.
+ The actual value of \s-1PAGESIZE\s0 is
+ implementation-dependent and may not be the same on all implementations.
+ .PP
+ If the \fIstackaddr\fR attribute has been set (that is, the caller
+ is allocating and managing its own thread stacks), the
+ \fIguardsize\fR attribute is ignored and no protection
+ will be provided by the implementation. It is the
+ responsibility of the application to manage stack overflow
+ along with stack allocation and management in this
+ case.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_attr_getguardsize()\fR
+ and
+ \fIpthread_attr_setguardsize()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_getguardsize()\fR
+ and
+ \fIpthread_attr_setguardsize()\fR
+ functions will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The attribute \fIattr\fR is invalid.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The parameter \fIguardsize\fR is invalid.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The parameter \fIguardsize\fR contains an invalid value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setinheritsched,\fR \fBpthread_attr_getinheritsched\fR
+ \- set and get inheritsched attribute
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setinheritsched\fR\|(pthread_attr_t *\fIattr\fR,
+ int \fIinheritsched\fR);
+ int \fIpthread_attr_getinheritsched\fR\|(const pthread_attr_t *\fIattr\fR,
+ int *\fIinheritsched\fR);
+ .SH "DESCRIPTION"
+ The functions
+ \fIpthread_attr_setinheritsched()\fR
+ and
+ \fIpthread_attr_getinheritsched()\fR,
+ respectively, set and get the
+ \fIinheritsched\fR
+ attribute in the
+ \fIattr\fR
+ argument.
+ .PP
+ When the attribute objects are used by
+ \fIpthread_create()\fR,
+ the
+ \fIinheritsched\fR
+ attribute determines how the other scheduling attributes of
+ the created thread are to be set:
+ .Ip "\s-1PTHREAD_INHERIT_SCHED\s0" 4
+ Specifies that the scheduling policy and associated attributes
+ are to be inherited from the creating thread, and the scheduling
+ attributes in this
+ \fIattr\fR
+ argument are to be ignored.
+ .Ip "\s-1PTHREAD_EXPLICIT_SCHED\s0" 4
+ Specifies that the scheduling policy and associated attributes
+ are to be set to the corresponding values from this attribute object.
+ .PP
+ The symbols \s-1PTHREAD_INHERIT_SCHED\s0 and \s-1PTHREAD_EXPLICIT_SCHED\s0
+ are defined in the header
+ \fI<pthread.h\fR>.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_attr_setinheritsched()\fR
+ and
+ \fIpthread_attr_getinheritsched()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_setinheritsched()\fR
+ and
+ \fIpthread_attr_getinheritsched()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_attr_setinheritsched()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with
+ the specified attributes using
+ \fIpthread_create()\fR.
+ Using these routines does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setscope()\fR,
+ \fIpthread_attr_setschedpolicy()\fR,
+ \fIpthread_attr_setschedparam()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setschedparam,\fR \fBpthread_attr_getschedparam\fR
+ \- set and get schedparam attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setschedparam\fR\|(pthread_attr_t *\fIattr\fR,
+ const struct sched_param *\fIparam\fR);
+ int \fIpthread_attr_getschedparam\fR\|(const pthread_attr_t *\fIattr\fR,
+ struct sched_param *\fIparam\fR);
+ .SH "DESCRIPTION"
+ The functions
+ \fIpthread_attr_setschedparam()\fR
+ and
+ \fIpthread_attr_getschedparam()\fR,
+ respectively, set and get the scheduling parameter
+ attributes in the
+ \fIattr\fR
+ argument.
+ The contents of the
+ \fIparam\fR
+ structure are defined in
+ \fI<sched.h\fR>.
+ For the SCHED_FIFO and SCHED_RR policies,
+ the only required member of
+ \fIparam\fR
+ is
+ \fIsched_priority\fR.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_attr_setschedparam()\fR
+ and
+ \fIpthread_attr_getschedparam()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_setschedparam()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .PP
+ The
+ \fIpthread_attr_setschedparam()\fR
+ and
+ \fIpthread_attr_getschedparam()\fR
+ functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with
+ the specified attributes using
+ \fIpthread_create()\fR.
+ Using these routines does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setscope()\fR,
+ \fIpthread_attr_setinheritsched()\fR,
+ \fIpthread_attr_setschedpolicy()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setschedpolicy,\fR \fBpthread_attr_getschedpolicy\fR
+ \- set and get schedpolicy attribute
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setschedpolicy\fR\|(pthread_attr_t *\fIattr\fR, int \fIpolicy\fR);
+ int \fIpthread_attr_getschedpolicy\fR\|(const pthread_attr_t *\fIattr\fR,
+ int *\fIpolicy\fR);
+ .SH "DESCRIPTION"
+ The functions
+ \fIpthread_attr_setschedpolicy()\fR
+ and
+ \fIpthread_attr_getschedpolicy()\fR,
+ respectively, set and get the
+ \fIschedpolicy\fR
+ attribute in the
+ \fIattr\fR
+ argument.
+ .PP
+ The supported values of
+ \fIpolicy\fR
+ include SCHED_FIFO, SCHED_RR and SCHED_OTHER,
+ which are defined by the header
+ \fI<sched.h\fR>.
+ When threads executing with the scheduling policy
+ SCHED_FIFO or SCHED_RR are waiting on a mutex,
+ they acquire the mutex in priority order when the mutex is unlocked.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_attr_setschedpolicy()\fR
+ and
+ \fIpthread_attr_getschedpolicy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_setschedpolicy()\fR
+ and
+ \fIpthread_attr_getschedpolicy()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_attr_setschedpolicy()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with
+ the specified attributes using
+ \fIpthread_create()\fR.
+ Using these routines does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setscope()\fR,
+ \fIpthread_attr_setinheritsched()\fR,
+ \fIpthread_attr_setschedparam()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setscope,\fR \fBpthread_attr_getscope\fR
+ \- set and get contentionscope attribute
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setscope\fR\|(pthread_attr_t *\fIattr\fR, int \fIcontentionscope\fR);
+ int \fIpthread_attr_getscope\fR\|(const pthread_attr_t *\fIattr\fR,
+ int *\fIcontentionscope\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_attr_setscope()\fR
+ and
+ \fIpthread_attr_getscope()\fR
+ functions are used to set and get the
+ \fIcontentionscope\fR
+ attribute in the
+ \fIattr\fR
+ object.
+ .PP
+ The
+ \fIcontentionscope\fR
+ attribute may have the values
+ PTHREAD_SCOPE_SYSTEM,
+ signifying system scheduling contention scope,
+ or PTHREAD_SCOPE_PROCESS,
+ signifying process scheduling contention scope.
+ The symbols PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS
+ are defined by the header
+ \fI<pthread.h\fR>.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_attr_setscope()\fR
+ and
+ \fIpthread_attr_getscope()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_setscope()\fR
+ and
+ \fIpthread_attr_getscope()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_attr_setscope()\fR,
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the attribute being set is not valid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the attribute to an unsupported value.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ After these attributes have been set, a thread can be created with
+ the specified attributes using
+ \fIpthread_create()\fR.
+ Using these routines does not affect the current running thread.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setinheritsched()\fR,
+ \fIpthread_attr_setschedpolicy()\fR,
+ \fIpthread_attr_setschedparam()\fR,
+ \fIpthread_create()\fR,
+ \fI<pthread.h\fR>,
+ \fIpthread_setschedparam()\fR,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setstackaddr,\fR \fBpthread_attr_getstackaddr\fR
+ \- set and get stackaddr attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setstackaddr\fR\|(pthread_attr_t *\fIattr\fR, void *\fIstackaddr\fR);
+ int \fIpthread_attr_getstackaddr\fR\|(const pthread_attr_t *\fIattr\fR,
+ void **\fIstackaddr\fR);
+ .SH "DESCRIPTION"
+ The functions
+ \fIpthread_attr_setstackaddr()\fR
+ and
+ \fIpthread_attr_getstackaddr()\fR,
+ respectively, set and get the thread creation
+ \fIstackaddr\fR
+ attribute in the
+ \fIattr\fR
+ object.
+ .PP
+ The
+ \fIstackaddr\fR
+ attribute specifies the location of storage
+ to be used for the created thread's stack.
+ The size of the storage is at least PTHREAD_STACK_MIN.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_attr_setstackaddr()\fR
+ and
+ \fIpthread_attr_getstackaddr()\fR
+ return a value of 0.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ The
+ \fIpthread_attr_getstackaddr()\fR
+ function stores the
+ \fIstackaddr\fR
+ attribute value in
+ \fIstackaddr\fR
+ if successful.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ These functions will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setdetachstate()\fR,
+ \fIpthread_attr_setstacksize()\fR,
+ \fIpthread_create()\fR,
+ \fI<limits.h\fR>,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_attr_setstacksize,\fR \fBpthread_attr_getstacksize\fR
+ \- set and get stacksize attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_attr_setstacksize\fR\|(pthread_attr_t *\fIattr\fR, size_t \fIstacksize\fR);
+ int \fIpthread_attr_getstacksize\fR\|(const pthread_attr_t *\fIattr\fR,
+ size_t *\fIstacksize\fR);
+ .SH "DESCRIPTION"
+ The functions
+ \fIpthread_attr_setstacksize()\fR
+ and
+ \fIpthread_attr_getstacksize()\fR,
+ respectively, set and get the thread creation
+ \fIstacksize\fR
+ attribute in the
+ \fIattr\fR
+ object.
+ .PP
+ The
+ \fIstacksize\fR
+ attribute defines the minimum stack size (in bytes) allocated for
+ the created threads stack.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_attr_setstacksize()\fR
+ and
+ \fIpthread_attr_getstacksize()\fR
+ return a value of 0.
+ Otherwise, an error number is returned to indicate the error.
+ The
+ \fIpthread_attr_getstacksize()\fR
+ function stores the
+ \fIstacksize\fR
+ attribute value in
+ \fIstacksize\fR
+ if successful.
+ .SH "ERRORS"
+ The
+ \fIpthread_attr_setstacksize()\fR
+ function will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of
+ \fIstacksize\fR
+ is less than \s-1PTHREAD_STACK_MIN\s0 or exceeds a system-imposed limit.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_attr_init()\fR,
+ \fIpthread_attr_setstackaddr()\fR,
+ \fIpthread_attr_setdetachstate()\fR,
+ \fIpthread_create()\fR,
+ \fI<limits.h\fR>,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cancel\fR \- cancel execution of a thread
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_cancel\fR\|(pthread_t \fIthread\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_cancel()\fR
+ function requests that
+ \fIthread\fR
+ be canceled.
+ The target threads cancelability state and type
+ determines when the cancellation takes effect.
+ When the cancellation is acted on, the
+ cancellation cleanup handlers for
+ \fIthread\fR
+ are called.
+ When the last cancellation cleanup handler returns,
+ the thread-specific data destructor functions are called for
+ \fIthread\fR.
+ When the last destructor function returns,
+ \fIthread\fR
+ is terminated.
+ .PP
+ The cancellation processing in the target thread runs asynchronously
+ with respect to the calling thread returning from
+ \fIpthread_cancel()\fR.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_cancel()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_cancel()\fR
+ function may fail if:
+ .Ip "[\s-1ESRCH\s0]" 4
+ No thread could be found corresponding to that specified
+ by the given thread \s-1ID\s0.
+ .PP
+ The
+ \fIpthread_cancel()\fR
+ function will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_exit()\fR,
+ \fIpthread_join()\fR,
+ \fIpthread_setcancelstate()\fR,
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_cond_timedwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cleanup_push,\fR \fBpthread_cleanup_pop\fR \- establish cancellation handlers
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ void \fIpthread_cleanup_push\fR\|(void (*\fIroutine\fR)(void*), void *\fIarg\fR);
+ void \fIpthread_cleanup_pop\fR\|(int \fIexecute\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_cleanup_push()\fR
+ function pushes the specified cancellation cleanup handler
+ \fIroutine\fR
+ onto the calling thread's cancellation cleanup stack.
+ The cancellation cleanup handler is popped from the
+ cancellation cleanup stack and invoked with the argument
+ \fIarg\fR
+ when: (a) the thread exits (that is, calls
+ \fIpthread_exit()\fR),
+ (b) the thread acts upon a cancellation request, or
+ (c) the thread calls
+ \fIpthread_cleanup_pop()\fR
+ with a non-zero
+ \fIexecute\fR
+ argument.
+ .PP
+ The
+ \fIpthread_cleanup_pop()\fR
+ function removes the routine at the top of the calling thread's
+ cancellation cleanup stack and optionally invokes it (if
+ \fIexecute\fR
+ is non-zero).
+ .PP
+ These functions may be implemented as macros and will
+ appear as statements and in pairs within the same lexical scope (that is, the
+ \fIpthread_cleanup_push()\fR
+ macro may be thought to expand to a token list whose first
+ token is
+ \fB`{\*(R'\fR
+ with
+ \fIpthread_cleanup_pop()\fR
+ expanding to a token list whose last token is the corresponding
+ \fB`}\*(R'\fR.
+ .PP
+ The effect of calling
+ \fIlongjmp()\fR
+ or
+ \fIsiglongjmp()\fR
+ is undefined if there have been any calls to
+ \fIpthread_cleanup_push()\fR
+ or
+ \fIpthread_cleanup_pop()\fR
+ made without the matching call
+ since the jump buffer was filled.
+ The effect of calling
+ \fIlongjmp()\fR
+ or
+ \fIsiglongjmp()\fR
+ from inside a cancellation cleanup handler is also
+ undefined unless the jump buffer was also filled in the
+ cancellation cleanup handler.
+ .SH "RETURN VALUE"
+ The
+ \fIpthread_cleanup_push()\fR
+ and
+ \fIpthread_cleanup_pop()\fR
+ functions return no value.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ These functions will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cancel()\fR,
+ \fIpthread_setcancelstate()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cleanup_push,\fR \fBpthread_cleanup_pop\fR \- establish cancellation handlers
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ void \fIpthread_cleanup_push\fR\|(void (*\fIroutine\fR)(void*), void *\fIarg\fR);
+ void \fIpthread_cleanup_pop\fR\|(int \fIexecute\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_cleanup_push()\fR
+ function pushes the specified cancellation cleanup handler
+ \fIroutine\fR
+ onto the calling thread's cancellation cleanup stack.
+ The cancellation cleanup handler is popped from the
+ cancellation cleanup stack and invoked with the argument
+ \fIarg\fR
+ when: (a) the thread exits (that is, calls
+ \fIpthread_exit()\fR),
+ (b) the thread acts upon a cancellation request, or
+ (c) the thread calls
+ \fIpthread_cleanup_pop()\fR
+ with a non-zero
+ \fIexecute\fR
+ argument.
+ .PP
+ The
+ \fIpthread_cleanup_pop()\fR
+ function removes the routine at the top of the calling thread's
+ cancellation cleanup stack and optionally invokes it (if
+ \fIexecute\fR
+ is non-zero).
+ .PP
+ These functions may be implemented as macros and will
+ appear as statements and in pairs within the same lexical scope (that is, the
+ \fIpthread_cleanup_push()\fR
+ macro may be thought to expand to a token list whose first
+ token is
+ \fB`{\*(R'\fR
+ with
+ \fIpthread_cleanup_pop()\fR
+ expanding to a token list whose last token is the corresponding
+ \fB`}\*(R'\fR.
+ .PP
+ The effect of calling
+ \fIlongjmp()\fR
+ or
+ \fIsiglongjmp()\fR
+ is undefined if there have been any calls to
+ \fIpthread_cleanup_push()\fR
+ or
+ \fIpthread_cleanup_pop()\fR
+ made without the matching call
+ since the jump buffer was filled.
+ The effect of calling
+ \fIlongjmp()\fR
+ or
+ \fIsiglongjmp()\fR
+ from inside a cancellation cleanup handler is also
+ undefined unless the jump buffer was also filled in the
+ cancellation cleanup handler.
+ .SH "RETURN VALUE"
+ The
+ \fIpthread_cleanup_push()\fR
+ and
+ \fIpthread_cleanup_pop()\fR
+ functions return no value.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ These functions will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cancel()\fR,
+ \fIpthread_setcancelstate()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cond_signal,\fR \fBpthread_cond_broadcast\fR \- signal or broadcast a
+ condition
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_cond_signal\fR\|(pthread_cond_t *\fIcond\fR);
+ int \fIpthread_cond_broadcast\fR\|(pthread_cond_t *\fIcond\fR);
+ .SH "DESCRIPTION"
+ These two functions are used to unblock
+ threads blocked on a condition variable.
+ .PP
+ The
+ \fIpthread_cond_signal()\fR
+ call unblocks at least one of the threads that are blocked on the
+ specified condition variable
+ \fIcond\fR
+ (if any threads are blocked on
+ \fIcond\fR).
+ .PP
+ The
+ \fIpthread_cond_broadcast()\fR
+ call unblocks all threads currently blocked on the specified condition variable
+ \fIcond\fR.
+ .PP
+ If more than one thread is blocked on a condition variable,
+ the scheduling policy determines the order in which threads are unblocked.
+ When each thread unblocked as a result of a
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR
+ returns from its call to
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR,
+ the thread owns the mutex with which it called
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR.
+ The \fIthread\fR\|(s) that are unblocked contend for the mutex
+ according to the scheduling policy (if applicable),
+ and as if each had called
+ \fIpthread_mutex_lock()\fR.
+ .PP
+ The
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR
+ functions may be called by a thread whether or not it
+ currently owns the mutex that threads calling
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ have associated with the condition variable during their waits;
+ however, if predictable scheduling behaviour is required,
+ then that mutex is locked by the thread calling
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR.
+ .PP
+ The
+ \fIpthread_cond_signal()\fR
+ and
+ \fIpthread_cond_broadcast()\fR
+ functions have no effect if there are no threads
+ currently blocked on
+ \fIcond\fR.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_cond_signal()\fR
+ and
+ \fIpthread_cond_broadcast()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_cond_signal()\fR
+ and
+ \fIpthread_cond_broadcast()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value
+ \fIcond\fR
+ does not refer to an initialised condition variable.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_init()\fR,
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_cond_timedwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cond_init,\fR \fBpthread_cond_destroy\fR \- initialise and destroy
+ condition variables
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_cond_init\fR\|(pthread_cond_t *\fIcond\fR,
+ const pthread_condattr_t *\fIattr\fR);
+ int \fIpthread_cond_destroy\fR\|(pthread_cond_t *\fIcond\fR);
+ pthread_cond_t \fIcond\fR = PTHREAD_COND_INITIALIZER;
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_cond_init()\fR
+ initialises the condition variable referenced by
+ \fIcond\fR
+ with attributes referenced by
+ \fIattr\fR.
+ If
+ \fIattr\fR
+ is NULL,
+ the default condition variable attributes are used;
+ the effect is the same as passing the address
+ of a default condition variable attributes object.
+ Upon successful initialisation,
+ the state of the condition variable becomes initialised.
+ .PP
+ Attempting to initialise an already initialised
+ condition variable
+ results in undefined behaviour.
+ .PP
+ The function
+ \fIpthread_cond_destroy()\fR
+ destroys the given condition variable specified by
+ \fIcond\fR;
+ the object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_cond_destroy()\fR
+ to set the object referenced by
+ \fIcond\fR
+ to an invalid value.
+ A destroyed condition variable object
+ can be re-initialised using
+ \fIpthread_cond_init()\fR;
+ the results of otherwise referencing the object after it has been destroyed
+ are undefined.
+ .PP
+ It is safe to destroy an initialised condition variable
+ upon which no threads are currently blocked.
+ Attempting to destroy a condition variable
+ upon which other threads are currently blocked
+ results in undefined behaviour.
+ .PP
+ In cases where default condition variable attributes are appropriate,
+ the macro PTHREAD_COND_INITIALIZER
+ can be used to initialise condition variables that are statically allocated.
+ The effect is equivalent to dynamic initialisation by a call to
+ \fIpthread_cond_init()\fR
+ with parameter
+ \fIattr\fR
+ specified as NULL, except that no error checks are performed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_cond_init()\fR
+ and
+ \fIpthread_cond_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ The [EBUSY] and [EINVAL]
+ error checks, if implemented,
+ act as if they were performed immediately
+ at the beginning of processing for the function
+ and caused an error return
+ prior to modifying the state of the condition variable specified by
+ \fIcond\fR.
+ .SH "ERRORS"
+ The
+ \fIpthread_cond_init()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources (other
+ than memory) to initialise another condition variable.
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the condition variable.
+ .PP
+ The
+ \fIpthread_cond_init()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt
+ to re-initialise the object referenced by
+ \fIcond\fR,
+ a previously initialised, but
+ not yet destroyed, condition variable.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_cond_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to destroy
+ the object referenced by
+ \fIcond\fR
+ while it is referenced
+ (for example, while being used in a
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR)
+ by another thread.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIcond\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_signal()\fR,
+ \fIpthread_cond_broadcast()\fR,
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_cond_timedwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cond_init,\fR \fBpthread_cond_destroy\fR \- initialise and destroy
+ condition variables
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_cond_init\fR\|(pthread_cond_t *\fIcond\fR,
+ const pthread_condattr_t *\fIattr\fR);
+ int \fIpthread_cond_destroy\fR\|(pthread_cond_t *\fIcond\fR);
+ pthread_cond_t \fIcond\fR = PTHREAD_COND_INITIALIZER;
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_cond_init()\fR
+ initialises the condition variable referenced by
+ \fIcond\fR
+ with attributes referenced by
+ \fIattr\fR.
+ If
+ \fIattr\fR
+ is NULL,
+ the default condition variable attributes are used;
+ the effect is the same as passing the address
+ of a default condition variable attributes object.
+ Upon successful initialisation,
+ the state of the condition variable becomes initialised.
+ .PP
+ Attempting to initialise an already initialised
+ condition variable
+ results in undefined behaviour.
+ .PP
+ The function
+ \fIpthread_cond_destroy()\fR
+ destroys the given condition variable specified by
+ \fIcond\fR;
+ the object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_cond_destroy()\fR
+ to set the object referenced by
+ \fIcond\fR
+ to an invalid value.
+ A destroyed condition variable object
+ can be re-initialised using
+ \fIpthread_cond_init()\fR;
+ the results of otherwise referencing the object after it has been destroyed
+ are undefined.
+ .PP
+ It is safe to destroy an initialised condition variable
+ upon which no threads are currently blocked.
+ Attempting to destroy a condition variable
+ upon which other threads are currently blocked
+ results in undefined behaviour.
+ .PP
+ In cases where default condition variable attributes are appropriate,
+ the macro PTHREAD_COND_INITIALIZER
+ can be used to initialise condition variables that are statically allocated.
+ The effect is equivalent to dynamic initialisation by a call to
+ \fIpthread_cond_init()\fR
+ with parameter
+ \fIattr\fR
+ specified as NULL, except that no error checks are performed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_cond_init()\fR
+ and
+ \fIpthread_cond_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ The [EBUSY] and [EINVAL]
+ error checks, if implemented,
+ act as if they were performed immediately
+ at the beginning of processing for the function
+ and caused an error return
+ prior to modifying the state of the condition variable specified by
+ \fIcond\fR.
+ .SH "ERRORS"
+ The
+ \fIpthread_cond_init()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources (other
+ than memory) to initialise another condition variable.
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the condition variable.
+ .PP
+ The
+ \fIpthread_cond_init()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt
+ to re-initialise the object referenced by
+ \fIcond\fR,
+ a previously initialised, but
+ not yet destroyed, condition variable.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_cond_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to destroy
+ the object referenced by
+ \fIcond\fR
+ while it is referenced
+ (for example, while being used in a
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR)
+ by another thread.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIcond\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_signal()\fR,
+ \fIpthread_cond_broadcast()\fR,
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_cond_timedwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cond_signal,\fR \fBpthread_cond_broadcast\fR \- signal or broadcast a
+ condition
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_cond_signal\fR\|(pthread_cond_t *\fIcond\fR);
+ int \fIpthread_cond_broadcast\fR\|(pthread_cond_t *\fIcond\fR);
+ .SH "DESCRIPTION"
+ These two functions are used to unblock
+ threads blocked on a condition variable.
+ .PP
+ The
+ \fIpthread_cond_signal()\fR
+ call unblocks at least one of the threads that are blocked on the
+ specified condition variable
+ \fIcond\fR
+ (if any threads are blocked on
+ \fIcond\fR).
+ .PP
+ The
+ \fIpthread_cond_broadcast()\fR
+ call unblocks all threads currently blocked on the specified condition variable
+ \fIcond\fR.
+ .PP
+ If more than one thread is blocked on a condition variable,
+ the scheduling policy determines the order in which threads are unblocked.
+ When each thread unblocked as a result of a
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR
+ returns from its call to
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR,
+ the thread owns the mutex with which it called
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR.
+ The \fIthread\fR\|(s) that are unblocked contend for the mutex
+ according to the scheduling policy (if applicable),
+ and as if each had called
+ \fIpthread_mutex_lock()\fR.
+ .PP
+ The
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR
+ functions may be called by a thread whether or not it
+ currently owns the mutex that threads calling
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ have associated with the condition variable during their waits;
+ however, if predictable scheduling behaviour is required,
+ then that mutex is locked by the thread calling
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR.
+ .PP
+ The
+ \fIpthread_cond_signal()\fR
+ and
+ \fIpthread_cond_broadcast()\fR
+ functions have no effect if there are no threads
+ currently blocked on
+ \fIcond\fR.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_cond_signal()\fR
+ and
+ \fIpthread_cond_broadcast()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_cond_signal()\fR
+ and
+ \fIpthread_cond_broadcast()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value
+ \fIcond\fR
+ does not refer to an initialised condition variable.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_init()\fR,
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_cond_timedwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cond_wait,\fR \fBpthread_cond_timedwait\fR \- wait on a condition
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_cond_wait\fR\|(pthread_cond_t *\fIcond\fR, pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_cond_timedwait\fR\|(pthread_cond_t *\fIcond\fR,
+ pthread_mutex_t *\fImutex\fR, const struct timespec *\fIabstime\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_cond_wait()\fR
+ and
+ \fIpthread_cond_timedwait()\fR
+ functions are used to block on a condition variable.
+ They are called with
+ \fImutex\fR
+ locked by the calling thread or undefined behaviour will result.
+ .PP
+ These functions atomically release
+ \fImutex\fR
+ and cause the calling thread to block on the condition variable
+ \fIcond\fR;
+ atomically here means "atomically with respect to access by another
+ thread to the mutex and then the condition variable".
+ That is, if another thread is able to acquire the mutex
+ after the about-to-block thread has released it,
+ then a subsequent call to
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR
+ in that thread behaves as if it were issued
+ after the about-to-block thread has blocked.
+ .PP
+ Upon successful return, the mutex has been
+ locked and is owned by the calling thread.
+ .PP
+ When using condition variables there is always a boolean predicate involving
+ shared variables associated with each condition wait that is true if the thread
+ should proceed.
+ Spurious wakeups from the
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ functions may occur.
+ Since the return from
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ does not imply anything about the value of this predicate,
+ the predicate should be re-evaluated upon such return.
+ .PP
+ The effect of using more than one mutex for concurrent
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ operations on the same condition variable is
+ undefined; that is, a condition variable becomes bound to a unique mutex
+ when a thread
+ waits on the condition variable,
+ and this (dynamic) binding ends when the wait returns.
+ .PP
+ A condition wait (whether timed or not) is a cancellation point.
+ When the cancelability enable state of a thread is set to
+ PTHREAD_CANCEL_DEFERRED,
+ a side effect of acting upon a cancellation request
+ while in a condition wait is that the mutex is (in effect) re-acquired
+ before calling the first cancellation cleanup handler.
+ The effect is as if the thread were unblocked,
+ allowed to execute up to the point of returning from the
+ call to
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR,
+ but at that point
+ notices the cancellation request and instead of returning to the caller
+ of
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR,
+ starts the thread cancellation activities, which includes calling
+ cancellation cleanup handlers.
+ .PP
+ A thread that has been unblocked because it has been
+ canceled while blocked in a call to
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ does not consume any condition signal that may be
+ directed concurrently at the
+ condition variable if there are other threads blocked on
+ the condition variable.
+ .PP
+ The
+ \fIpthread_cond_timedwait()\fR
+ function is the same as
+ \fIpthread_cond_wait()\fR
+ except that
+ an error is returned
+ if the absolute time specified by
+ \fIabstime\fR
+ passes (that is, system time equals or exceeds
+ \fIabstime\fR)
+ before the condition
+ \fIcond\fR
+ is signaled or broadcasted,
+ or if the absolute time specified by
+ \fIabstime\fR
+ has already been passed at the time of the call.
+ When such time-outs occur,
+ \fIpthread_cond_timedwait()\fR
+ will nonetheless release
+ and reacquire the mutex referenced by
+ \fImutex\fR.
+ The function
+ \fIpthread_cond_timedwait()\fR
+ is also a cancellation point.
+ .PP
+ If a signal is delivered to a thread waiting for a condition variable,
+ upon return from the signal handler
+ the thread resumes waiting for the condition variable
+ as if it was not interrupted,
+ or it returns zero due to spurious wakeup.
+ .SH "RETURN VALUE"
+ Except in the case of [ETIMEDOUT],
+ all these error checks act as if they were performed immediately
+ at the beginning of processing for the function
+ and cause an error return,
+ in effect, prior to modifying the state of the mutex specified by
+ \fImutex\fR
+ or the condition variable specified by
+ \fIcond\fR.
+ .PP
+ Upon successful completion, a value of zero is returned.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_cond_timedwait()\fR
+ function will fail if:
+ .Ip "[\s-1ETIMEDOUT\s0]" 4
+ The time specified by
+ \fIabstime\fR
+ to
+ \fIpthread_cond_timedwait()\fR
+ has passed.
+ .PP
+ The
+ \fIpthread_cond_wait()\fR
+ and
+ \fIpthread_cond_timedwait()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIcond\fR,
+ \fImutex\fR,
+ or
+ \fIabstime\fR
+ is invalid.
+ .Ip "[\s-1EINVAL\s0]" 4
+ Different mutexes were supplied for concurrent
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ operations on the same condition variable.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The mutex was not owned by the current thread at the time of the call.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_signal()\fR,
+ \fIpthread_cond_broadcast()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_cond_wait,\fR \fBpthread_cond_timedwait\fR \- wait on a condition
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_cond_wait\fR\|(pthread_cond_t *\fIcond\fR, pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_cond_timedwait\fR\|(pthread_cond_t *\fIcond\fR,
+ pthread_mutex_t *\fImutex\fR, const struct timespec *\fIabstime\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_cond_wait()\fR
+ and
+ \fIpthread_cond_timedwait()\fR
+ functions are used to block on a condition variable.
+ They are called with
+ \fImutex\fR
+ locked by the calling thread or undefined behaviour will result.
+ .PP
+ These functions atomically release
+ \fImutex\fR
+ and cause the calling thread to block on the condition variable
+ \fIcond\fR;
+ atomically here means "atomically with respect to access by another
+ thread to the mutex and then the condition variable".
+ That is, if another thread is able to acquire the mutex
+ after the about-to-block thread has released it,
+ then a subsequent call to
+ \fIpthread_cond_signal()\fR
+ or
+ \fIpthread_cond_broadcast()\fR
+ in that thread behaves as if it were issued
+ after the about-to-block thread has blocked.
+ .PP
+ Upon successful return, the mutex has been
+ locked and is owned by the calling thread.
+ .PP
+ When using condition variables there is always a boolean predicate involving
+ shared variables associated with each condition wait that is true if the thread
+ should proceed.
+ Spurious wakeups from the
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ functions may occur.
+ Since the return from
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ does not imply anything about the value of this predicate,
+ the predicate should be re-evaluated upon such return.
+ .PP
+ The effect of using more than one mutex for concurrent
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ operations on the same condition variable is
+ undefined; that is, a condition variable becomes bound to a unique mutex
+ when a thread
+ waits on the condition variable,
+ and this (dynamic) binding ends when the wait returns.
+ .PP
+ A condition wait (whether timed or not) is a cancellation point.
+ When the cancelability enable state of a thread is set to
+ PTHREAD_CANCEL_DEFERRED,
+ a side effect of acting upon a cancellation request
+ while in a condition wait is that the mutex is (in effect) re-acquired
+ before calling the first cancellation cleanup handler.
+ The effect is as if the thread were unblocked,
+ allowed to execute up to the point of returning from the
+ call to
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR,
+ but at that point
+ notices the cancellation request and instead of returning to the caller
+ of
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR,
+ starts the thread cancellation activities, which includes calling
+ cancellation cleanup handlers.
+ .PP
+ A thread that has been unblocked because it has been
+ canceled while blocked in a call to
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ does not consume any condition signal that may be
+ directed concurrently at the
+ condition variable if there are other threads blocked on
+ the condition variable.
+ .PP
+ The
+ \fIpthread_cond_timedwait()\fR
+ function is the same as
+ \fIpthread_cond_wait()\fR
+ except that
+ an error is returned
+ if the absolute time specified by
+ \fIabstime\fR
+ passes (that is, system time equals or exceeds
+ \fIabstime\fR)
+ before the condition
+ \fIcond\fR
+ is signaled or broadcasted,
+ or if the absolute time specified by
+ \fIabstime\fR
+ has already been passed at the time of the call.
+ When such time-outs occur,
+ \fIpthread_cond_timedwait()\fR
+ will nonetheless release
+ and reacquire the mutex referenced by
+ \fImutex\fR.
+ The function
+ \fIpthread_cond_timedwait()\fR
+ is also a cancellation point.
+ .PP
+ If a signal is delivered to a thread waiting for a condition variable,
+ upon return from the signal handler
+ the thread resumes waiting for the condition variable
+ as if it was not interrupted,
+ or it returns zero due to spurious wakeup.
+ .SH "RETURN VALUE"
+ Except in the case of [ETIMEDOUT],
+ all these error checks act as if they were performed immediately
+ at the beginning of processing for the function
+ and cause an error return,
+ in effect, prior to modifying the state of the mutex specified by
+ \fImutex\fR
+ or the condition variable specified by
+ \fIcond\fR.
+ .PP
+ Upon successful completion, a value of zero is returned.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_cond_timedwait()\fR
+ function will fail if:
+ .Ip "[\s-1ETIMEDOUT\s0]" 4
+ The time specified by
+ \fIabstime\fR
+ to
+ \fIpthread_cond_timedwait()\fR
+ has passed.
+ .PP
+ The
+ \fIpthread_cond_wait()\fR
+ and
+ \fIpthread_cond_timedwait()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIcond\fR,
+ \fImutex\fR,
+ or
+ \fIabstime\fR
+ is invalid.
+ .Ip "[\s-1EINVAL\s0]" 4
+ Different mutexes were supplied for concurrent
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ operations on the same condition variable.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The mutex was not owned by the current thread at the time of the call.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_signal()\fR,
+ \fIpthread_cond_broadcast()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_condattr_init,\fR \fBpthread_condattr_destroy\fR
+ \- initialise and destroy condition variable attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_condattr_init\fR\|(pthread_condattr_t *\fIattr\fR);
+ int \fIpthread_condattr_destroy\fR\|(pthread_condattr_t *\fIattr\fR);
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_condattr_init()\fR
+ initialises a condition variable attributes object
+ \fIattr\fR
+ with the default value for all of the attributes
+ defined by the implementation.
+ .PP
+ Attempting to initialise an already initialised
+ condition variable attributes object
+ results in undefined behaviour.
+ .PP
+ After a condition variable
+ attributes object has been used to initialise one or more
+ condition variables, any function affecting the attributes object (including
+ destruction) does not affect any previously initialised condition variables.
+ .PP
+ The
+ \fIpthread_condattr_destroy()\fR
+ function destroys a condition variable attributes object;
+ the object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_condattr_destroy()\fR
+ to set the object referenced by
+ \fIattr\fR
+ to an invalid value.
+ A destroyed condition variable attributes object
+ can be re-initialised using
+ \fIpthread_condattr_init()\fR;
+ the results of otherwise referencing the object after it has been destroyed
+ are undefined.
+ .PP
+ Additional attributes, their default values, and the names
+ of the associated functions to get and set those attribute values are
+ implementation-dependent.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_condattr_init()\fR
+ and
+ \fIpthread_condattr_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_condattr_init()\fR
+ function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the condition variable
+ attributes object.
+ .PP
+ The
+ \fIpthread_condattr_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_condattr_getpshared()\fR,
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_condattr_getpshared,\fR \fBpthread_condattr_setpshared\fR
+ \- get and set the process-shared condition variable attributes
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_condattr_getpshared\fR\|(const pthread_condattr_t *\fIattr\fR,
+ int *\fIpshared\fR);
+ int \fIpthread_condattr_setpshared\fR\|(pthread_condattr_t *\fIattr\fR,
+ int \fIpshared\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_condattr_getpshared()\fR
+ function obtains the value of the
+ \fIprocess-shared\fR
+ attribute from the attributes object referenced by
+ \fIattr\fR.
+ The
+ \fIpthread_condattr_setpshared()\fR
+ function is used to set the
+ \fIprocess-shared\fR
+ attribute in an initialised attributes object referenced by
+ \fIattr\fR.
+ .PP
+ The
+ \fIprocess-shared\fR
+ attribute is set to PTHREAD_PROCESS_SHARED
+ to permit a condition variable
+ to be operated upon by any thread that has access to the memory
+ where the condition variable
+ is allocated, even if the condition variable
+ is allocated in memory that is shared by multiple processes.
+ If the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE, the condition variable
+ will only be operated upon by threads created
+ within the same process as the
+ thread that initialised the condition variable;
+ if threads of differing processes
+ attempt to operate on such a condition variable, the behaviour is
+ undefined. The default value of the attribute is
+ PTHREAD_PROCESS_PRIVATE.
+ .PP
+ Additional attributes, their default values, and the names
+ of the associated functions to get and set those attribute values are
+ implementation-dependent.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_condattr_setpshared()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ If successful, the
+ \fIpthread_condattr_getpshared()\fR
+ function returns zero
+ and stores the value of the
+ \fIprocess-shared\fR
+ attribute of
+ \fIattr\fR
+ into the object referenced by the
+ \fIpshared\fR
+ parameter.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_condattr_getpshared()\fR
+ and
+ \fIpthread_condattr_setpshared()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_condattr_setpshared()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The new value specified for the attribute
+ is outside the range of legal values for that attribute.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_condattr_init()\fR,
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_condattr_init,\fR \fBpthread_condattr_destroy\fR
+ \- initialise and destroy condition variable attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_condattr_init\fR\|(pthread_condattr_t *\fIattr\fR);
+ int \fIpthread_condattr_destroy\fR\|(pthread_condattr_t *\fIattr\fR);
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_condattr_init()\fR
+ initialises a condition variable attributes object
+ \fIattr\fR
+ with the default value for all of the attributes
+ defined by the implementation.
+ .PP
+ Attempting to initialise an already initialised
+ condition variable attributes object
+ results in undefined behaviour.
+ .PP
+ After a condition variable
+ attributes object has been used to initialise one or more
+ condition variables, any function affecting the attributes object (including
+ destruction) does not affect any previously initialised condition variables.
+ .PP
+ The
+ \fIpthread_condattr_destroy()\fR
+ function destroys a condition variable attributes object;
+ the object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_condattr_destroy()\fR
+ to set the object referenced by
+ \fIattr\fR
+ to an invalid value.
+ A destroyed condition variable attributes object
+ can be re-initialised using
+ \fIpthread_condattr_init()\fR;
+ the results of otherwise referencing the object after it has been destroyed
+ are undefined.
+ .PP
+ Additional attributes, their default values, and the names
+ of the associated functions to get and set those attribute values are
+ implementation-dependent.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_condattr_init()\fR
+ and
+ \fIpthread_condattr_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_condattr_init()\fR
+ function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the condition variable
+ attributes object.
+ .PP
+ The
+ \fIpthread_condattr_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_condattr_getpshared()\fR,
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_condattr_getpshared,\fR \fBpthread_condattr_setpshared\fR
+ \- get and set the process-shared condition variable attributes
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_condattr_getpshared\fR\|(const pthread_condattr_t *\fIattr\fR,
+ int *\fIpshared\fR);
+ int \fIpthread_condattr_setpshared\fR\|(pthread_condattr_t *\fIattr\fR,
+ int \fIpshared\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_condattr_getpshared()\fR
+ function obtains the value of the
+ \fIprocess-shared\fR
+ attribute from the attributes object referenced by
+ \fIattr\fR.
+ The
+ \fIpthread_condattr_setpshared()\fR
+ function is used to set the
+ \fIprocess-shared\fR
+ attribute in an initialised attributes object referenced by
+ \fIattr\fR.
+ .PP
+ The
+ \fIprocess-shared\fR
+ attribute is set to PTHREAD_PROCESS_SHARED
+ to permit a condition variable
+ to be operated upon by any thread that has access to the memory
+ where the condition variable
+ is allocated, even if the condition variable
+ is allocated in memory that is shared by multiple processes.
+ If the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE, the condition variable
+ will only be operated upon by threads created
+ within the same process as the
+ thread that initialised the condition variable;
+ if threads of differing processes
+ attempt to operate on such a condition variable, the behaviour is
+ undefined. The default value of the attribute is
+ PTHREAD_PROCESS_PRIVATE.
+ .PP
+ Additional attributes, their default values, and the names
+ of the associated functions to get and set those attribute values are
+ implementation-dependent.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_condattr_setpshared()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ If successful, the
+ \fIpthread_condattr_getpshared()\fR
+ function returns zero
+ and stores the value of the
+ \fIprocess-shared\fR
+ attribute of
+ \fIattr\fR
+ into the object referenced by the
+ \fIpshared\fR
+ parameter.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_condattr_getpshared()\fR
+ and
+ \fIpthread_condattr_setpshared()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_condattr_setpshared()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The new value specified for the attribute
+ is outside the range of legal values for that attribute.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_condattr_init()\fR,
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_create\fR \- thread creation
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_create\fR\|(pthread_t *\fIthread\fR, const pthread_attr_t *\fIattr\fR,
+ void *(*\fIstart_routine\fR)(void*), void *\fIarg\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_create()\fR
+ function is used to create a new thread, with attributes specified by
+ \fIattr\fR,
+ within a process.
+ If
+ \fIattr\fR
+ is NULL,
+ the default attributes are used.
+ If the attributes specified by
+ \fIattr\fR
+ are modified later, the thread's attributes are not affected.
+ Upon successful completion,
+ \fIpthread_create()\fR
+ stores the ID of the created thread in the location referenced by
+ \fIthread\fR.
+ .PP
+ The thread is created executing
+ \fIstart_routine\fR
+ with
+ \fIarg\fR
+ as its sole argument.
+ If the
+ \fIstart_routine\fR
+ returns, the effect is as if there was an implicit call to
+ \fIpthread_exit()\fR
+ using the return value of
+ \fIstart_routine\fR
+ as the exit status.
+ Note that the thread in which
+ \fImain()\fR
+ was originally invoked differs from this.
+ When it returns from
+ \fImain()\fR,
+ the effect is as if there was an implicit call to
+ \fIexit()\fR
+ using the return value of
+ \fImain()\fR
+ as the exit status.
+ .PP
+ The signal state of the new thread is initialised as follows:
+ .Ip "o" 4
+ The signal mask is inherited from the creating thread.
+ .Ip "o" 4
+ The set of signals pending for the new thread is empty.
+ .PP
+ If
+ \fIpthread_create()\fR
+ fails, no new thread is created
+ and the contents of the location referenced by
+ \fIthread\fR
+ are undefined.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_create()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_create()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources to create another thread,
+ or the system-imposed limit on the total number of threads
+ in a process \s-1PTHREAD_THREADS_MAX\s0 would be exceeded.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have appropriate permission to set the required
+ scheduling parameters or scheduling policy.
+ .PP
+ The
+ \fIpthread_create()\fR
+ function will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_exit()\fR,
+ \fIpthread_join()\fR,
+ \fIfork()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_detach\fR \- detach a thread
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_detach\fR\|(pthread_t \fIthread\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_detach()\fR
+ function is used to indicate to the implementation that storage
+ for the thread
+ \fIthread\fR
+ can be reclaimed when that thread terminates.
+ If
+ \fIthread\fR
+ has not terminated,
+ \fIpthread_detach()\fR
+ will not cause it to terminate.
+ The effect of multiple
+ \fIpthread_detach()\fR
+ calls on the same target thread is unspecified.
+ .SH "RETURN VALUE"
+ If the call succeeds,
+ \fIpthread_detach()\fR
+ returns 0.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_detach()\fR
+ function will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The implementation has detected that the value specified by
+ \fIthread\fR
+ does not refer to a joinable thread.
+ .Ip "[\s-1ESRCH\s0]" 4
+ No thread could be found corresponding to that specified
+ by the given thread \s-1ID\s0.
+ .PP
+ The
+ \fIpthread_detach()\fR
+ function will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_join()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_equal\fR \- compare thread IDs
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_equal\fR\|(pthread_t \fIt1\fR, pthread_t \fIt2\fR);
+ .SH "DESCRIPTION"
+ This function compares the thread IDs
+ \fIt1\fR
+ and
+ \fIt2\fR.
+ .SH "RETURN VALUE"
+ The
+ \fIpthread_equal()\fR
+ function returns a non-zero value if
+ \fIt1\fR
+ and
+ \fIt2\fR
+ are equal;
+ otherwise, zero is returned.
+ .PP
+ If either
+ \fIt1\fR
+ or
+ \fIt2\fR
+ are not valid thread IDs, the behaviour is undefined.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ The
+ \fIpthread_equal()\fR
+ function will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_self()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_exit\fR \- thread termination
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ void \fIpthread_exit\fR\|(void *\fIvalue_ptr\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_exit()\fR
+ function terminates the calling thread and makes the value
+ \fIvalue_ptr\fR
+ available to any successful join with the terminating thread.
+ Any cancellation cleanup handlers
+ that have been pushed and not yet popped are popped in the reverse order
+ that they were pushed and then executed.
+ After all cancellation cleanup handlers have been executed,
+ if the thread has any thread-specific data,
+ appropriate destructor functions will be called in an unspecified order.
+ Thread termination does not release any application visible process resources,
+ including, but not limited to, mutexes and file descriptors,
+ nor does it perform any process level cleanup actions,
+ including, but not limited to, calling any
+ \fIatexit()\fR
+ routines that may exist.
+ .PP
+ An implicit call to
+ \fIpthread_exit()\fR
+ is made when a thread other than the thread in which
+ \fImain()\fR
+ was first invoked returns from the start routine
+ that was used to create it.
+ The function's return value serves as the thread's exit status.
+ .PP
+ The behaviour of
+ \fIpthread_exit()\fR
+ is undefined if called from a
+ cancellation cleanup handler
+ or destructor function
+ that was invoked as a result of either an implicit or
+ explicit call to
+ \fIpthread_exit()\fR.
+ .PP
+ After a thread has terminated,
+ the result of access to local (auto) variables of the thread is undefined.
+ Thus, references to local variables of the exiting thread
+ should not be used for the
+ \fIpthread_exit()\fR
+ \fIvalue_ptr\fR
+ parameter value.
+ .PP
+ The process exits with an exit status of 0 after the
+ last thread has been terminated.
+ The behaviour is as if the implementation called
+ \fIexit()\fR
+ with a zero argument at thread termination time.
+ .SH "RETURN VALUE"
+ The
+ \fIpthread_exit()\fR
+ function cannot return to its caller.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ The
+ \fIpthread_exit()\fR
+ function will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_join()\fR,
+ \fIexit()\fR,
+ \fI_exit()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_getconcurrency,\fR \fBpthread_setconcurrency\fR \-
+ get or set level of concurrency
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_getconcurrency\fR\|(void);
+ int \fIpthread_setconcurrency\fR\|(int \fInew_level\fR);
+ .SH "DESCRIPTION"
+ Unbound threads in a process may or may not be required to be
+ simultaneously active. By default, the threads
+ implementation ensures that a sufficient number of threads are active
+ so that the process can continue to make
+ progress. While this conserves system resources, it may not produce
+ the most effective level of concurrency.
+ .PP
+ The
+ \fIpthread_setconcurrency()\fR
+ function allows an application to inform
+ the threads implementation of its desired concurrency level,
+ \fInew_level\fR.
+ The actual level of concurrency provided by the implementation as a
+ result of this function call is unspecified.
+ .PP
+ If \fInew_level\fR is zero, it causes the implementation to maintain
+ the concurrency level at its discretion as if
+ \fIpthread_setconcurrency()\fR
+ was never called.
+ .PP
+ The
+ \fIpthread_getconcurrency()\fR
+ function returns the
+ value set by a previous call to the
+ \fIpthread_setconcurrency()\fR
+ function. If the
+ \fIpthread_setconcurrency()\fR
+ function was not previously called,
+ this function returns zero to indicate that the implementation
+ is maintaining the concurrency level.
+ .PP
+ When an application calls
+ \fIpthread_setconcurrency()\fR
+ it is
+ informing the implementation of its desired
+ concurrency level. The implementation uses this as a hint,
+ not a requirement.
+ .PP
+ If an implementation does not support multiplexing of user threads
+ on top of several kernel scheduled entities,
+ the
+ \fIpthread_setconcurrency()\fR
+ and
+ \fIpthread_getconcurrency()\fR
+ functions
+ will be provided for source code
+ compatibility but they will have no effect when called. To maintain
+ the function semantics, the \fInew_level\fR
+ parameter will be saved when
+ \fIpthread_setconcurrency()\fR
+ is called so
+ that a subsequent call to
+ \fIpthread_getconcurrency()\fR
+ returns the same value.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_setconcurrency()\fR
+ function returns zero. Otherwise, an error number is returned
+ to indicate the error.
+ .PP
+ The
+ \fIpthread_getconcurrency()\fR
+ function always returns the concurrency level set by a previous call to
+ \fIpthread_setconcurrency()\fR.
+ If the
+ \fIpthread_setconcurrency()\fR
+ function has never been called,
+ \fIpthread_getconcurrency()\fR
+ returns zero.
+ .SH "ERRORS"
+ The
+ \fIpthread_setconcurrency()\fR
+ function will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fInew_level\fR is negative.
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The value specific by \fInew_level\fR would cause a system resource
+ to be exceeded.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Use of these functions changes the state of the underlying
+ concurrency upon which the application depends. Library
+ developers are advised to not use the
+ \fIpthread_getconcurrency()\fR
+ and
+ \fIpthread_setconcurrency()\fR
+ functions since their
+ use may conflict with an applications use of these functions.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_getschedparam,\fR \fBpthread_setschedparam\fR
+ \- dynamic thread scheduling parameters access
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_getschedparam\fR\|(pthread_t \fIthread\fR, int *\fIpolicy\fR,
+ struct sched_param *\fIparam\fR);
+ int \fIpthread_setschedparam\fR\|(pthread_t \fIthread\fR, int \fIpolicy\fR,
+ const struct sched_param *\fIparam\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_getschedparam()\fR
+ and
+ \fIpthread_setschedparam()\fR
+ allow the scheduling policy and scheduling parameters of individual threads
+ within a multi-threaded process to be retrieved and set.
+ For SCHED_FIFO and SCHED_RR,
+ the only required member of the
+ \fBsched_param\fR
+ structure is the priority
+ \fIsched_priority\fR.
+ For SCHED_OTHER,
+ the affected scheduling parameters are implementation-dependent.
+ .PP
+ The
+ \fIpthread_getschedparam()\fR
+ function retrieves the scheduling policy and scheduling parameters
+ for the thread whose thread ID is given by
+ \fIthread\fR
+ and stores those values in
+ \fIpolicy\fR
+ and
+ \fIparam\fR,
+ respectively.
+ The priority value returned from
+ \fIpthread_getschedparam()\fR
+ is the value specified by the most recent
+ \fIpthread_setschedparam()\fR
+ or
+ \fIpthread_create()\fR
+ call affecting the target thread,
+ and reflects any temporary adjustments to its priority
+ as a result of any priority inheritance or ceiling functions.
+ The
+ \fIpthread_setschedparam()\fR
+ function sets the scheduling policy
+ and associated scheduling parameters for the thread whose
+ thread ID is given by
+ \fIthread\fR
+ to the policy and associated parameters provided in
+ \fIpolicy\fR
+ and
+ \fIparam\fR,
+ respectively.
+ .PP
+ The
+ \fIpolicy\fR
+ parameter may have the value SCHED_OTHER,
+ that has implementation-dependent scheduling parameters,
+ SCHED_FIFO or SCHED_RR,
+ that have the single scheduling parameter,
+ \fIpriority.\fR
+ .PP
+ If the
+ \fIpthread_setschedparam()\fR
+ function fails, no scheduling parameters will be changed
+ for the target thread.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_getschedparam()\fR
+ and
+ \fIpthread_setschedparam()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_getschedparam()\fR
+ and
+ \fIpthread_setschedparam()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_getschedparam()\fR
+ function may fail if:
+ .Ip "[\s-1ESRCH\s0]" 4
+ The value specified by
+ \fIthread\fR
+ does not refer to a existing thread.
+ .PP
+ The
+ \fIpthread_setschedparam()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIpolicy\fR
+ or one of the scheduling parameters associated with
+ the scheduling policy
+ \fIpolicy\fR
+ is invalid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the policy or scheduling parameters to
+ an unsupported value.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the appropriate permission to set
+ either the scheduling parameters or the scheduling policy of the
+ specified thread.
+ .Ip "[\s-1EPERM\s0]" 4
+ The implementation does not allow the application to modify
+ one of the parameters to the value specified.
+ .Ip "[\s-1ESRCH\s0]" 4
+ The value specified by
+ \fIthread\fR
+ does not refer to a existing thread.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIsched_setparam()\fR,
+ \fIsched_getparam()\fR,
+ \fIsched_setscheduler()\fR,
+ \fIsched_getscheduler()\fR,
+ \fI<pthread.h\fR>,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_setspecific,\fR \fBpthread_getspecific\fR \- thread-specific data management
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_setspecific\fR\|(pthread_key_t \fIkey\fR, const void *\fIvalue\fR);
+ void *\fIpthread_getspecific\fR\|(pthread_key_t \fIkey\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_setspecific()\fR
+ function associates a thread-specific
+ \fIvalue\fR
+ with a
+ \fIkey\fR
+ obtained via a previous call to
+ \fIpthread_key_create()\fR.
+ Different threads may bind different values to the same key.
+ These values are typically pointers to blocks of dynamically allocated memory
+ that have been reserved for use by the calling thread.
+ .PP
+ The
+ \fIpthread_getspecific()\fR
+ function returns the value currently bound to the specified
+ \fIkey\fR
+ on behalf of the calling thread.
+ .PP
+ The effect of calling
+ \fIpthread_setspecific()\fR
+ or
+ \fIpthread_getspecific()\fR
+ with a
+ \fIkey\fR
+ value not obtained from
+ \fIpthread_key_create()\fR
+ or after
+ \fIkey\fR
+ has been deleted with
+ \fIpthread_key_delete()\fR
+ is undefined.
+ .PP
+ Both
+ \fIpthread_setspecific()\fR
+ and
+ \fIpthread_getspecific()\fR
+ may be called from a thread-specific data destructor function.
+ However, calling
+ \fIpthread_setspecific()\fR
+ from a destructor may result in lost storage or infinite loops.
+ .PP
+ Both functions may be implemented as macros.
+ .SH "RETURN VALUE"
+ The function
+ \fIpthread_getspecific()\fR
+ returns the thread-specific data value
+ associated with the given
+ \fIkey\fR.
+ If no thread-specific data value is associated with
+ \fIkey\fR,
+ then the value NULL is returned.
+ .PP
+ If successful, the
+ \fIpthread_setspecific()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_setspecific()\fR
+ function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to associate the value with the key.
+ .PP
+ The
+ \fIpthread_setspecific()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The key value is invalid.
+ .PP
+ No errors are returned from
+ \fIpthread_getspecific()\fR.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_key_create()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_join\fR \- wait for thread termination
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_join\fR\|(pthread_t \fIthread\fR, void **\fIvalue_ptr\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_join()\fR
+ function suspends execution of the calling thread until the target
+ \fIthread\fR
+ terminates, unless the target
+ \fIthread\fR
+ has already terminated.
+ On return from a successful
+ \fIpthread_join()\fR
+ call with a non-NULL
+ \fIvalue_ptr\fR
+ argument, the value passed to
+ \fIpthread_exit()\fR
+ by the terminating thread is made available in the location referenced by
+ \fIvalue_ptr\fR.
+ When a
+ \fIpthread_join()\fR
+ returns successfully, the target thread has been terminated.
+ The results of multiple simultaneous calls to
+ \fIpthread_join()\fR
+ specifying the same target thread are undefined.
+ If the thread calling
+ \fIpthread_join()\fR
+ is canceled, then the target thread will not be detached.
+ .PP
+ It is unspecified whether a thread that has exited but remains unjoined
+ counts against _POSIX_THREAD_THREADS_MAX.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_join()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_join()\fR
+ function will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The implementation has detected that the value specified by
+ \fIthread\fR
+ does not refer to a joinable thread.
+ .Ip "[\s-1ESRCH\s0]" 4
+ No thread could be found corresponding to that specified
+ by the given thread \s-1ID\s0.
+ .PP
+ The
+ \fIpthread_join()\fR
+ function may fail if:
+ .Ip "[\s-1EDEADLK\s0]" 4
+ A deadlock was detected or
+ the value of
+ \fIthread\fR
+ specifies the calling thread.
+ .PP
+ The
+ \fIpthread_join()\fR
+ function will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_key_create\fR \- thread-specific data key creation
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_key_create\fR\|(pthread_key_t *\fIkey\fR, void (*\fIdestructor\fR)(void*));
+ .SH "DESCRIPTION"
+ This function creates a thread-specific data
+ key visible to all threads in the process.
+ Key values provided by
+ \fIpthread_key_create()\fR
+ are opaque objects used to locate thread-specific data.
+ Although the same key value may be used by different threads,
+ the values bound to the key by
+ \fIpthread_setspecific()\fR
+ are maintained on a per-thread basis and persist
+ for the life of the calling thread.
+ .PP
+ Upon key creation,
+ the value NULL is associated with the new key in all active threads.
+ Upon thread creation,
+ the value NULL is associated with all defined keys in the new thread.
+ .PP
+ An optional destructor function may be associated with
+ each key value.
+ At thread exit, if a key value has a non-NULL destructor pointer,
+ and the thread has a non-NULL value associated with that key,
+ the function pointed to is called with the current associated value
+ as its sole argument.
+ The order of destructor calls is unspecified
+ if more than one destructor exists for a thread when it exits.
+ .PP
+ If, after all the destructors have been called for all non-NULL values
+ with associated destructors,
+ there are still some non-NULL values with associated destructors,
+ then the process will be repeated.
+ If, after at least PTHREAD_DESTRUCTOR_ITERATIONS
+ iterations of destructor calls for outstanding non-NULL values,
+ there are still some non-NULL values with associated destructors,
+ implementations may stop calling destructors,
+ or they may continue calling destructors
+ until no non-NULL values with associated destructors exist,
+ even though this might result in an infinite loop.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_key_create()\fR
+ function stores the newly created key value at
+ \fI*key\fR
+ and returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_key_create()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources to create another thread-specific
+ data key, or the system-imposed limit on the total number of keys per process
+ \s-1PTHREAD_KEYS_MAX\s0 has been exceeded.
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to create the key.
+ .PP
+ The
+ \fIpthread_key_create()\fR
+ function will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_getspecific()\fR,
+ \fIpthread_setspecific()\fR,
+ \fIpthread_key_delete()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_key_delete\fR \- thread-specific data key deletion
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_key_delete\fR\|(pthread_key_t \fIkey\fR);
+ .SH "DESCRIPTION"
+ This function deletes a thread-specific data
+ key previously returned by
+ \fIpthread_key_create()\fR.
+ The thread-specific data values associated with
+ \fIkey\fR
+ need not be NULL at the time
+ \fIpthread_key_delete()\fR
+ is called.
+ It is the responsibility of the application
+ to free any application storage
+ or perform any cleanup actions for data structures
+ related to the deleted key or associated thread-specific data
+ in any threads;
+ this cleanup can be done either before or after
+ \fIpthread_key_delete()\fR
+ is called.
+ Any attempt to use
+ \fIkey\fR
+ following the call to
+ \fIpthread_key_delete()\fR
+ results in undefined behaviour.
+ .PP
+ The
+ \fIpthread_key_delete()\fR
+ function is callable from within destructor functions.
+ No destructor functions will be invoked by
+ \fIpthread_key_delete()\fR.
+ Any destructor function that may have been associated with
+ \fIkey\fR
+ will no longer be called upon thread exit.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_key_delete()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_key_delete()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The
+ \fIkey\fR
+ value is invalid.
+ .PP
+ The
+ \fIpthread_key_delete()\fR
+ function will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_key_create()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_kill\fR \- send a signal to a thread
+ .SH "SYNOPSIS"
+ #include <signal.h>
+ .PP
+ int \fIpthread_kill\fR\|(pthread_t \fIthread\fR, int \fIsig\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_kill()\fR
+ function is used to request that a signal be delivered to the specified thread.
+ .PP
+ As in
+ \fIkill()\fR,
+ if
+ \fIsig\fR
+ is zero, error checking is performed but no signal is actually sent.
+ .SH "RETURN VALUE"
+ Upon successful completion, the function returns a value of zero.
+ Otherwise the function returns an error number.
+ If the
+ \fIpthread_kill()\fR
+ function fails, no signal is sent.
+ .SH "ERRORS"
+ The
+ \fIpthread_kill()\fR
+ function will fail if:
+ .Ip "[\s-1ESRCH\s0]" 4
+ No thread could be found corresponding to that specified
+ by the given thread \s-1ID\s0.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value of the
+ \fIsig\fR
+ argument is an invalid or unsupported signal number.
+ .PP
+ The
+ \fIpthread_kill()\fR
+ function will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIkill()\fR,
+ \fIpthread_self()\fR,
+ \fIraise()\fR,
+ \fI<signal.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutex_init,\fR \fBpthread_mutex_destroy\fR \- initialise or destroy a mutex
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutex_init\fR\|(pthread_mutex_t *\fImutex\fR,
+ const pthread_mutexattr_t *\fIattr\fR);
+ int \fIpthread_mutex_destroy\fR\|(pthread_mutex_t *\fImutex\fR);
+ pthread_mutex_t \fImutex\fR = PTHREAD_MUTEX_INITIALIZER;
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutex_init()\fR
+ function initialises the mutex referenced by
+ \fImutex\fR
+ with attributes specified
+ by
+ \fIattr\fR.
+ If
+ \fIattr\fR
+ is NULL,
+ the default mutex attributes are used; the effect is the same as
+ passing the address of a default mutex attributes object.
+ Upon successful initialisation, the state of the mutex becomes
+ initialised and unlocked.
+ .PP
+ Attempting to initialise an already initialised
+ mutex results in
+ undefined behaviour.
+ .PP
+ The
+ \fIpthread_mutex_destroy()\fR
+ function destroys the mutex object referenced by
+ \fImutex\fR;
+ the mutex object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_mutex_destroy()\fR
+ to set the object referenced by
+ \fImutex\fR
+ to an invalid value.
+ A destroyed mutex object
+ can be re-initialised using
+ \fIpthread_mutex_init()\fR;
+ the results of otherwise referencing the object after it has been destroyed
+ are undefined.
+ .PP
+ It is safe to destroy an initialised mutex that is unlocked.
+ Attempting to destroy a locked mutex results in
+ undefined behaviour.
+ .PP
+ In cases where default mutex attributes are appropriate,
+ the macro PTHREAD_MUTEX_INITIALIZER
+ can be used to initialise mutexes that are statically allocated.
+ The effect is equivalent to dynamic initialisation by a call to
+ \fIpthread_mutex_init()\fR
+ with parameter
+ \fIattr\fR
+ specified as NULL,
+ except that no error checks are performed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutex_init()\fR
+ and
+ \fIpthread_mutex_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ The [EBUSY] and [EINVAL] error checks, if implemented,
+ act as if they were performed immediately
+ at the beginning of processing for the function
+ and cause an error return
+ prior to modifying the state of the mutex specified by
+ \fImutex\fR.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutex_init()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources (other than memory)
+ to initialise another mutex.
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the mutex.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .PP
+ The
+ \fIpthread_mutex_init()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt
+ to re-initialise the object referenced by
+ \fImutex\fR,
+ a previously initialised, but
+ not yet destroyed, mutex.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_mutex_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to destroy
+ the object referenced by
+ \fImutex\fR
+ while it is locked or referenced
+ (for example, while being used in a
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR)
+ by another thread.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fImutex\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_mutex_getprioceiling()\fR,
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_unlock()\fR,
+ \fIpthread_mutex_setprioceiling()\fR,
+ \fIpthread_mutex_trylock()\fR,
+ \fIpthread_mutexattr_getpshared()\fR,
+ \fIpthread_mutexattr_setpshared()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutex_setprioceiling,\fR \fBpthread_mutex_getprioceiling\fR
+ \- change the priority ceiling of a mutex
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutex_setprioceiling\fR\|(pthread_mutex_t *\fImutex\fR, int \fIprioceiling\fR, int *\fIold_ceiling\fR);
+ .PP
+ int \fIpthread_mutex_getprioceiling\fR\|(const pthread_mutex_t *\fImutex\fR, int *\fIprioceiling\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutex_getprioceiling()\fR
+ function returns the current priority ceiling of the mutex.
+ .PP
+ The
+ \fIpthread_mutex_setprioceiling()\fR
+ function either locks the mutex if it is unlocked, or blocks until it can
+ successfully lock the mutex, then it
+ changes the mutex's priority ceiling and releases the mutex.
+ When the change is successful, the previous value of the
+ priority ceiling is returned in
+ \fIold_ceiling\fR.
+ The process of locking the mutex need not adhere
+ to the priority protect protocol.
+ .PP
+ If the
+ \fIpthread_mutex_setprioceiling()\fR
+ function fails, the mutex priority ceiling is not changed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutex_setprioceiling()\fR
+ and
+ \fIpthread_mutex_getprioceiling()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutex_getprioceiling()\fR
+ and
+ \fIpthread_mutex_setprioceiling()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIO_PROTECT is not defined and
+ the implementation does not support the function.
+ .PP
+ The
+ \fIpthread_mutex_setprioceiling()\fR
+ and
+ \fIpthread_mutex_getprioceiling()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The priority requested by
+ \fIprioceiling\fR
+ is out of range.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fImutex\fR
+ does not refer to a currently existing mutex.
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The implementation does not support the priority ceiling protocol for mutexes.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_unlock()\fR,
+ \fIpthread_mutex_trylock()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutex_init,\fR \fBpthread_mutex_destroy\fR \- initialise or destroy a mutex
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutex_init\fR\|(pthread_mutex_t *\fImutex\fR,
+ const pthread_mutexattr_t *\fIattr\fR);
+ int \fIpthread_mutex_destroy\fR\|(pthread_mutex_t *\fImutex\fR);
+ pthread_mutex_t \fImutex\fR = PTHREAD_MUTEX_INITIALIZER;
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutex_init()\fR
+ function initialises the mutex referenced by
+ \fImutex\fR
+ with attributes specified
+ by
+ \fIattr\fR.
+ If
+ \fIattr\fR
+ is NULL,
+ the default mutex attributes are used; the effect is the same as
+ passing the address of a default mutex attributes object.
+ Upon successful initialisation, the state of the mutex becomes
+ initialised and unlocked.
+ .PP
+ Attempting to initialise an already initialised
+ mutex results in
+ undefined behaviour.
+ .PP
+ The
+ \fIpthread_mutex_destroy()\fR
+ function destroys the mutex object referenced by
+ \fImutex\fR;
+ the mutex object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_mutex_destroy()\fR
+ to set the object referenced by
+ \fImutex\fR
+ to an invalid value.
+ A destroyed mutex object
+ can be re-initialised using
+ \fIpthread_mutex_init()\fR;
+ the results of otherwise referencing the object after it has been destroyed
+ are undefined.
+ .PP
+ It is safe to destroy an initialised mutex that is unlocked.
+ Attempting to destroy a locked mutex results in
+ undefined behaviour.
+ .PP
+ In cases where default mutex attributes are appropriate,
+ the macro PTHREAD_MUTEX_INITIALIZER
+ can be used to initialise mutexes that are statically allocated.
+ The effect is equivalent to dynamic initialisation by a call to
+ \fIpthread_mutex_init()\fR
+ with parameter
+ \fIattr\fR
+ specified as NULL,
+ except that no error checks are performed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutex_init()\fR
+ and
+ \fIpthread_mutex_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ The [EBUSY] and [EINVAL] error checks, if implemented,
+ act as if they were performed immediately
+ at the beginning of processing for the function
+ and cause an error return
+ prior to modifying the state of the mutex specified by
+ \fImutex\fR.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutex_init()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources (other than memory)
+ to initialise another mutex.
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the mutex.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .PP
+ The
+ \fIpthread_mutex_init()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt
+ to re-initialise the object referenced by
+ \fImutex\fR,
+ a previously initialised, but
+ not yet destroyed, mutex.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_mutex_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to destroy
+ the object referenced by
+ \fImutex\fR
+ while it is locked or referenced
+ (for example, while being used in a
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR)
+ by another thread.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fImutex\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_mutex_getprioceiling()\fR,
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_unlock()\fR,
+ \fIpthread_mutex_setprioceiling()\fR,
+ \fIpthread_mutex_trylock()\fR,
+ \fIpthread_mutexattr_getpshared()\fR,
+ \fIpthread_mutexattr_setpshared()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutex_lock,\fR \fBpthread_mutex_trylock,\fR \fBpthread_mutex_unlock\fR
+ \- lock and unlock a mutex
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutex_lock\fR\|(pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_mutex_trylock\fR\|(pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_mutex_unlock\fR\|(pthread_mutex_t *\fImutex\fR);
+ .SH "DESCRIPTION"
+ The mutex object referenced by
+ \fImutex\fR
+ is locked by calling
+ \fIpthread_mutex_lock()\fR.
+ If the mutex is already locked,
+ the calling thread blocks until the mutex becomes available.
+ This operation returns with the mutex object referenced by
+ \fImutex\fR
+ in the locked state with the calling thread as its owner.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection is not
+ provided. Attempting to
+ relock the mutex causes deadlock. If a thread attempts to unlock a
+ mutex that it has not locked or a mutex
+ which is unlocked, undefined behaviour results.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_ERRORCHECK, then
+ error checking is provided.
+ If a thread attempts to relock a mutex that it has already
+ locked, an error will be returned. If a thread
+ attempts to unlock a mutex that it has not locked or a mutex which
+ is unlocked, an error will be returned.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the mutex maintains
+ the concept of a lock count.
+ When a thread successfully acquires a mutex for the
+ first time, the lock count is set
+ to one. Every time a thread relocks this mutex, the lock count is
+ incremented by one. Each time the
+ thread unlocks the mutex, the lock count is decremented by one.
+ When the lock count reaches zero, the
+ mutex becomes available for other threads to acquire. If a thread
+ attempts to unlock a mutex that it has
+ not locked or a mutex which is unlocked, an error will be returned.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_DEFAULT, attempting to recursively
+ lock the mutex results in
+ undefined behaviour. Attempting to unlock the mutex if it was not
+ locked by the calling thread results in
+ undefined behaviour. Attempting to unlock the mutex if it is not
+ locked results in undefined behaviour.
+ .PP
+ The function
+ \fIpthread_mutex_trylock()\fR
+ is identical to
+ \fIpthread_mutex_lock()\fR
+ except that if the mutex object referenced by
+ \fImutex\fR
+ is currently locked (by any thread, including the
+ current thread), the call returns immediately.
+ .PP
+ The
+ \fIpthread_mutex_unlock()\fR
+ function releases the mutex object referenced by
+ \fImutex\fR.
+ The manner in which a mutex is released is dependent upon the mutex's
+ type attribute.
+ If there are threads blocked on the mutex object referenced by
+ \fImutex\fR when
+ \fIpthread_mutex_unlock()\fR
+ is called, resulting in the mutex
+ becoming available, the scheduling policy is used to determine
+ which thread shall acquire the mutex.
+ (In the case of PTHREAD_MUTEX_RECURSIVE mutexes, the mutex becomes
+ available when the count reaches zero and the calling thread no
+ longer has any locks on this mutex).
+ .PP
+ If a signal is delivered to a thread waiting for a mutex,
+ upon return from the signal handler the thread resumes waiting
+ for the mutex as if it was not interrupted.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutex_lock()\fR
+ and
+ \fIpthread_mutex_unlock()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ The function
+ \fIpthread_mutex_trylock()\fR
+ returns zero if a lock on the mutex object referenced by
+ \fImutex\fR
+ is acquired.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutex_lock()\fR
+ and
+ \fIpthread_mutex_trylock()\fR
+ functions will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The
+ \fImutex\fR
+ was created with the protocol attribute having the value
+ \s-1PTHREAD_PRIO_PROTECT\s0
+ and the calling thread's priority is higher
+ than the mutex's current priority ceiling.
+ .PP
+ The
+ \fIpthread_mutex_trylock()\fR
+ function will fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The
+ \fImutex\fR
+ could not be acquired because it was already locked.
+ .PP
+ The
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_trylock()\fR
+ and
+ \fIpthread_mutex_unlock()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fImutex\fR
+ does not refer to an initialised mutex object.
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The mutex could not be acquired because the maximum
+ number of recursive locks for \fImutex\fR has been exceeded.
+ .PP
+ The
+ \fIpthread_mutex_lock()\fR
+ function may fail if:
+ .Ip "[\s-1EDEADLK\s0]" 4
+ The current thread already owns the mutex.
+ .PP
+ The
+ \fIpthread_mutex_unlock()\fR
+ function may fail if:
+ .Ip "[\s-1EPERM\s0]" 4
+ The current thread does not own the mutex.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutex_destroy()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutex_setprioceiling,\fR \fBpthread_mutex_getprioceiling\fR
+ \- change the priority ceiling of a mutex
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutex_setprioceiling\fR\|(pthread_mutex_t *\fImutex\fR, int
+ \fIprioceiling\fR, int *\fIold_ceiling\fR);
+ .PP
+ int \fIpthread_mutex_getprioceiling\fR\|(const pthread_mutex_t *\fImutex\fR,
+ int *\fIprioceiling\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutex_getprioceiling()\fR
+ function returns the current priority ceiling of the mutex.
+ .PP
+ The
+ \fIpthread_mutex_setprioceiling()\fR
+ function either locks the mutex if it is unlocked, or blocks until it can
+ successfully lock the mutex, then it
+ changes the mutex's priority ceiling and releases the mutex.
+ When the change is successful, the previous value of the
+ priority ceiling is returned in
+ \fIold_ceiling\fR.
+ The process of locking the mutex need not adhere
+ to the priority protect protocol.
+ .PP
+ If the
+ \fIpthread_mutex_setprioceiling()\fR
+ function fails, the mutex priority ceiling is not changed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutex_setprioceiling()\fR
+ and
+ \fIpthread_mutex_getprioceiling()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutex_getprioceiling()\fR
+ and
+ \fIpthread_mutex_setprioceiling()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIO_PROTECT is not defined and
+ the implementation does not support the function.
+ .PP
+ The
+ \fIpthread_mutex_setprioceiling()\fR
+ and
+ \fIpthread_mutex_getprioceiling()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The priority requested by
+ \fIprioceiling\fR
+ is out of range.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fImutex\fR
+ does not refer to a currently existing mutex.
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The implementation does not support the priority ceiling protocol for mutexes.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_unlock()\fR,
+ \fIpthread_mutex_trylock()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutex_lock,\fR \fBpthread_mutex_trylock,\fR \fBpthread_mutex_unlock\fR
+ \- lock and unlock a mutex
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutex_lock\fR\|(pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_mutex_trylock\fR\|(pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_mutex_unlock\fR\|(pthread_mutex_t *\fImutex\fR);
+ .SH "DESCRIPTION"
+ The mutex object referenced by
+ \fImutex\fR
+ is locked by calling
+ \fIpthread_mutex_lock()\fR.
+ If the mutex is already locked,
+ the calling thread blocks until the mutex becomes available.
+ This operation returns with the mutex object referenced by
+ \fImutex\fR
+ in the locked state with the calling thread as its owner.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection is not
+ provided. Attempting to
+ relock the mutex causes deadlock. If a thread attempts to unlock a
+ mutex that it has not locked or a mutex
+ which is unlocked, undefined behaviour results.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_ERRORCHECK, then
+ error checking is provided.
+ If a thread attempts to relock a mutex that it has already
+ locked, an error will be returned. If a thread
+ attempts to unlock a mutex that it has not locked or a mutex which
+ is unlocked, an error will be returned.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the mutex maintains
+ the concept of a lock count.
+ When a thread successfully acquires a mutex for the
+ first time, the lock count is set
+ to one. Every time a thread relocks this mutex, the lock count is
+ incremented by one. Each time the
+ thread unlocks the mutex, the lock count is decremented by one.
+ When the lock count reaches zero, the
+ mutex becomes available for other threads to acquire. If a thread
+ attempts to unlock a mutex that it has
+ not locked or a mutex which is unlocked, an error will be returned.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_DEFAULT, attempting to recursively
+ lock the mutex results in
+ undefined behaviour. Attempting to unlock the mutex if it was not
+ locked by the calling thread results in
+ undefined behaviour. Attempting to unlock the mutex if it is not
+ locked results in undefined behaviour.
+ .PP
+ The function
+ \fIpthread_mutex_trylock()\fR
+ is identical to
+ \fIpthread_mutex_lock()\fR
+ except that if the mutex object referenced by
+ \fImutex\fR
+ is currently locked (by any thread, including the
+ current thread), the call returns immediately.
+ .PP
+ The
+ \fIpthread_mutex_unlock()\fR
+ function releases the mutex object referenced by
+ \fImutex\fR.
+ The manner in which a mutex is released is dependent upon the mutex's
+ type attribute.
+ If there are threads blocked on the mutex object referenced by
+ \fImutex\fR when
+ \fIpthread_mutex_unlock()\fR
+ is called, resulting in the mutex
+ becoming available, the scheduling policy is used to determine
+ which thread shall acquire the mutex.
+ (In the case of PTHREAD_MUTEX_RECURSIVE mutexes, the mutex becomes
+ available when the count reaches zero and the calling thread no
+ longer has any locks on this mutex).
+ .PP
+ If a signal is delivered to a thread waiting for a mutex,
+ upon return from the signal handler the thread resumes waiting
+ for the mutex as if it was not interrupted.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutex_lock()\fR
+ and
+ \fIpthread_mutex_unlock()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ The function
+ \fIpthread_mutex_trylock()\fR
+ returns zero if a lock on the mutex object referenced by
+ \fImutex\fR
+ is acquired.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutex_lock()\fR
+ and
+ \fIpthread_mutex_trylock()\fR
+ functions will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The
+ \fImutex\fR
+ was created with the protocol attribute having the value
+ \s-1PTHREAD_PRIO_PROTECT\s0
+ and the calling thread's priority is higher
+ than the mutex's current priority ceiling.
+ .PP
+ The
+ \fIpthread_mutex_trylock()\fR
+ function will fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The
+ \fImutex\fR
+ could not be acquired because it was already locked.
+ .PP
+ The
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_trylock()\fR
+ and
+ \fIpthread_mutex_unlock()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fImutex\fR
+ does not refer to an initialised mutex object.
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The mutex could not be acquired because the maximum
+ number of recursive locks for \fImutex\fR has been exceeded.
+ .PP
+ The
+ \fIpthread_mutex_lock()\fR
+ function may fail if:
+ .Ip "[\s-1EDEADLK\s0]" 4
+ The current thread already owns the mutex.
+ .PP
+ The
+ \fIpthread_mutex_unlock()\fR
+ function may fail if:
+ .Ip "[\s-1EPERM\s0]" 4
+ The current thread does not own the mutex.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutex_destroy()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutex_lock,\fR \fBpthread_mutex_trylock,\fR \fBpthread_mutex_unlock\fR
+ \- lock and unlock a mutex
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutex_lock\fR\|(pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_mutex_trylock\fR\|(pthread_mutex_t *\fImutex\fR);
+ int \fIpthread_mutex_unlock\fR\|(pthread_mutex_t *\fImutex\fR);
+ .SH "DESCRIPTION"
+ The mutex object referenced by
+ \fImutex\fR
+ is locked by calling
+ \fIpthread_mutex_lock()\fR.
+ If the mutex is already locked,
+ the calling thread blocks until the mutex becomes available.
+ This operation returns with the mutex object referenced by
+ \fImutex\fR
+ in the locked state with the calling thread as its owner.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection is not
+ provided. Attempting to
+ relock the mutex causes deadlock. If a thread attempts to unlock a
+ mutex that it has not locked or a mutex
+ which is unlocked, undefined behaviour results.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_ERRORCHECK, then
+ error checking is provided.
+ If a thread attempts to relock a mutex that it has already
+ locked, an error will be returned. If a thread
+ attempts to unlock a mutex that it has not locked or a mutex which
+ is unlocked, an error will be returned.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_RECURSIVE, then the mutex maintains
+ the concept of a lock count.
+ When a thread successfully acquires a mutex for the
+ first time, the lock count is set
+ to one. Every time a thread relocks this mutex, the lock count is
+ incremented by one. Each time the
+ thread unlocks the mutex, the lock count is decremented by one.
+ When the lock count reaches zero, the
+ mutex becomes available for other threads to acquire. If a thread
+ attempts to unlock a mutex that it has
+ not locked or a mutex which is unlocked, an error will be returned.
+ .PP
+ If the mutex type is PTHREAD_MUTEX_DEFAULT, attempting to recursively
+ lock the mutex results in
+ undefined behaviour. Attempting to unlock the mutex if it was not
+ locked by the calling thread results in
+ undefined behaviour. Attempting to unlock the mutex if it is not
+ locked results in undefined behaviour.
+ .PP
+ The function
+ \fIpthread_mutex_trylock()\fR
+ is identical to
+ \fIpthread_mutex_lock()\fR
+ except that if the mutex object referenced by
+ \fImutex\fR
+ is currently locked (by any thread, including the
+ current thread), the call returns immediately.
+ .PP
+ The
+ \fIpthread_mutex_unlock()\fR
+ function releases the mutex object referenced by
+ \fImutex\fR.
+ The manner in which a mutex is released is dependent upon the mutex's
+ type attribute.
+ If there are threads blocked on the mutex object referenced by
+ \fImutex\fR when
+ \fIpthread_mutex_unlock()\fR
+ is called, resulting in the mutex
+ becoming available, the scheduling policy is used to determine
+ which thread shall acquire the mutex.
+ (In the case of PTHREAD_MUTEX_RECURSIVE mutexes, the mutex becomes
+ available when the count reaches zero and the calling thread no
+ longer has any locks on this mutex).
+ .PP
+ If a signal is delivered to a thread waiting for a mutex,
+ upon return from the signal handler the thread resumes waiting
+ for the mutex as if it was not interrupted.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutex_lock()\fR
+ and
+ \fIpthread_mutex_unlock()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ The function
+ \fIpthread_mutex_trylock()\fR
+ returns zero if a lock on the mutex object referenced by
+ \fImutex\fR
+ is acquired.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutex_lock()\fR
+ and
+ \fIpthread_mutex_trylock()\fR
+ functions will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The
+ \fImutex\fR
+ was created with the protocol attribute having the value
+ \s-1PTHREAD_PRIO_PROTECT\s0
+ and the calling thread's priority is higher
+ than the mutex's current priority ceiling.
+ .PP
+ The
+ \fIpthread_mutex_trylock()\fR
+ function will fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The
+ \fImutex\fR
+ could not be acquired because it was already locked.
+ .PP
+ The
+ \fIpthread_mutex_lock()\fR,
+ \fIpthread_mutex_trylock()\fR
+ and
+ \fIpthread_mutex_unlock()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fImutex\fR
+ does not refer to an initialised mutex object.
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The mutex could not be acquired because the maximum
+ number of recursive locks for \fImutex\fR has been exceeded.
+ .PP
+ The
+ \fIpthread_mutex_lock()\fR
+ function may fail if:
+ .Ip "[\s-1EDEADLK\s0]" 4
+ The current thread already owns the mutex.
+ .PP
+ The
+ \fIpthread_mutex_unlock()\fR
+ function may fail if:
+ .Ip "[\s-1EPERM\s0]" 4
+ The current thread does not own the mutex.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutex_destroy()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_init,\fR \fBpthread_mutexattr_destroy\fR
+ \- initialise and destroy mutex attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_init\fR\|(pthread_mutexattr_t *\fIattr\fR);
+ int \fIpthread_mutexattr_destroy\fR\|(pthread_mutexattr_t *\fIattr\fR);
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_mutexattr_init()\fR
+ initialises a mutex attributes object
+ \fIattr\fR
+ with the default value for all of the attributes
+ defined by the implementation.
+ .PP
+ The effect of initialising an already initialised mutex
+ attributes object is undefined.
+ .PP
+ After a mutex attributes object has been used
+ to initialise one or more mutexes,
+ any function affecting the attributes object (including destruction)
+ does not affect any previously initialised mutexes.
+ .PP
+ The
+ \fIpthread_mutexattr_destroy()\fR
+ function destroys a mutex attributes object;
+ the object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_mutexattr_destroy()\fR
+ to set the object referenced by
+ \fIattr\fR
+ to an invalid value.
+ A destroyed mutex attributes object
+ can be re-initialised using
+ \fIpthread_mutexattr_init()\fR;
+ the results of otherwise referencing the object after it has been
+ destroyed are undefined.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_mutexattr_init()\fR
+ and
+ \fIpthread_mutexattr_destroy()\fR
+ return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_init()\fR
+ function may fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the mutex attributes object.
+ .PP
+ The
+ \fIpthread_mutexattr_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutexattr_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_setprioceiling,\fR \fBpthread_mutexattr_getprioceiling\fR
+ \- set and get prioceiling attribute of mutex attribute object
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_setprioceiling\fR\|(pthread_mutexattr_t *\fIattr\fR,
+ int \fIprioceiling\fR);
+ int \fIpthread_mutexattr_getprioceiling\fR\|(const pthread_mutexattr_t *\fIattr\fR,
+ int *\fIprioceiling\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions, respectively, set and get the priority ceiling attribute of
+ a mutex attribute object pointed to by
+ \fIattr\fR
+ which was previously created by the function
+ \fIpthread_mutexattr_init()\fR.
+ .PP
+ The
+ \fIprioceiling\fR
+ attribute contains the priority ceiling of initialised mutexes.
+ The values of
+ \fIprioceiling\fR
+ will be within the maximum range of priorities defined by SCHED_FIFO.
+ .PP
+ The
+ \fIprioceiling\fR
+ attribute defines the priority ceiling of initialised mutexes,
+ which is the minimum priority level
+ at which the critical section guarded by the mutex is executed.
+ In order to avoid priority inversion,
+ the priority ceiling of the mutex will be set to a priority
+ higher than or equal to the highest priority of all the threads
+ that may lock that mutex.
+ The values of
+ \fIprioceiling\fR
+ will be within the maximum range of priorities
+ defined under the SCHED_FIFO scheduling policy.
+ .SH "RETURN VALUE"
+ Upon successful completion, the
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIO_PROTECT is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ or
+ \fIprioceiling\fR
+ is invalid.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_setprotocol,\fR \fBpthread_mutexattr_getprotocol\fR
+ \- set and get protocol attribute of mutex attribute object
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_setprotocol\fR\|(pthread_mutexattr_t *\fIattr\fR,
+ int \fIprotocol\fR);
+ int \fIpthread_mutexattr_getprotocol\fR\|(const pthread_mutexattr_t *\fIattr\fR,
+ int *\fIprotocol\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions, respectively, set and get the protocol attribute of a mutex
+ attribute object pointed to by
+ \fIattr\fR
+ which was previously created by the function
+ \fIpthread_mutexattr_init()\fR.
+ .PP
+ The
+ \fIprotocol\fR
+ attribute defines the protocol to be followed in utilising mutexes.
+ The value of
+ \fIprotocol\fR
+ may be one of PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT or
+ PTHREAD_PRIO_PROTECT, which are defined by the header
+ \fI<pthread.h\fR>.
+ .PP
+ When a thread owns a mutex with the PTHREAD_PRIO_NONE
+ protocol attribute, its priority and scheduling are not affected
+ by its mutex ownership.
+ .PP
+ When a thread is blocking higher priority threads because of owning one or
+ more mutexes with the PTHREAD_PRIO_INHERIT
+ protocol attribute, it executes at the higher of its priority
+ or the priority of the highest priority thread waiting on any of the mutexes
+ owned by this thread and initialised with this protocol.
+ .PP
+ When a thread owns one or more mutexes initialised with the
+ PTHREAD_PRIO_PROTECT
+ protocol, it executes at the higher of its priority or the highest
+ of the priority ceilings of all the mutexes
+ owned by this thread and initialised with this attribute,
+ regardless of whether other threads are blocked on any of these
+ mutexes or not.
+ .PP
+ While a thread is holding a mutex which has been initialised with the
+ PRIO_INHERIT or PRIO_PROTECT protocol attributes,
+ it will not be subject to being moved
+ to the tail of the scheduling queue at its priority
+ in the event that its original priority is changed,
+ such as by a call to
+ \fIsched_setparam()\fR.
+ Likewise,
+ when a thread unlocks a mutex that has been initialised with the
+ PRIO_INHERIT or PRIO_PROTECT protocol attributes,
+ it will not be subject to being moved
+ to the tail of the scheduling queue at its priority
+ in the event that its original priority is changed.
+ .PP
+ If a thread simultaneously owns several mutexes
+ initialised with different protocols,
+ it will execute at the highest of the priorities
+ that it would have obtained by each of these protocols.
+ .PP
+ When a thread makes a call to
+ \fIpthread_mutex_lock()\fR,
+ if the symbol _POSIX_THREAD_PRIO_INHERIT
+ is defined and the mutex was
+ initialised with the protocol attribute having the value
+ PTHREAD_PRIO_INHERIT, when the calling thread is blocked
+ because the mutex is owned by another thread,
+ that owner thread will inherit the priority level
+ of the calling thread as long as it continues to own the mutex.
+ The implementation updates its execution priority
+ to the maximum of its assigned priority and all its inherited priorities.
+ Furthermore, if this owner thread itself becomes blocked on another mutex,
+ the same priority inheritance effect will be propagated
+ to this other owner thread, in a recursive manner.
+ .SH "RETURN VALUE"
+ Upon successful completion, the
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ Neither one of the options _POSIX_THREAD_PRIO_PROTECT and
+ _POSIX_THREAD_PRIO_INHERIT is defined and the implementation does not
+ support the function.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ The value specified by
+ \fIprotocol\fR
+ is an unsupported value.
+ .PP
+ The
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ ro
+ \fIprotocol\fR
+ is invalid.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_getpshared,\fR \fBpthread_mutexattr_setpshared\fR
+ \- set and get process-shared attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_getpshared\fR\|(const pthread_mutexattr_t *\fIattr\fR,
+ int *\fIpshared\fR);
+ int \fIpthread_mutexattr_setpshared\fR\|(pthread_mutexattr_t *\fIattr\fR,
+ int \fIpshared\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_getpshared()\fR
+ function obtains the value of the
+ \fIprocess-shared\fR
+ attribute from the attributes object referenced by
+ \fIattr\fR.
+ The
+ \fIpthread_mutexattr_setpshared()\fR
+ function is used to set the
+ \fIprocess-shared\fR
+ attribute in an initialised attributes object referenced by
+ \fIattr\fR.
+ .PP
+ The
+ \fIprocess-shared\fR
+ attribute is set to PTHREAD_PROCESS_SHARED to permit a mutex
+ to be operated upon by any thread that has access to the memory
+ where the mutex is allocated, even if the mutex
+ is allocated in memory that is shared by multiple processes.
+ If the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE, the mutex will only be operated upon
+ by threads created within the same process as the thread
+ that initialised the mutex;
+ if threads of differing processes attempt to operate on such a mutex,
+ the behaviour is undefined.
+ The default value of the attribute is
+ PTHREAD_PROCESS_PRIVATE.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_mutexattr_setpshared()\fR
+ returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ Upon successful completion,
+ \fIpthread_mutexattr_getpshared()\fR
+ returns zero and stores the value of the
+ \fIprocess-shared\fR
+ attribute of
+ \fIattr\fR
+ into the object referenced by the
+ \fIpshared\fR
+ parameter.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_getpshared()\fR
+ and
+ \fIpthread_mutexattr_setpshared()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_mutexattr_setpshared()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The new value specified for the attribute
+ is outside the range of legal values for that attribute.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutexattr_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_gettype,\fR \fBpthread_mutexattr_settype\fR
+ \- get or set a mutex type
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_gettype\fR\|(const pthread_mutexattr_t \fI*attr\fR, int \fI*type\fR);
+ int \fIpthread_mutexattr_settype\fR\|(pthread_mutexattr_t \fI*attr\fR, int \fItype\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_gettype()\fR
+ and
+ \fIpthread_mutexattr_settype()\fR
+ functions respectively get and set the mutex \fItype\fR attribute.
+ This attribute is set in the \fItype\fR parameter
+ to these functions. The default value of the \fItype\fR
+ attribute is PTHREAD_MUTEX_DEFAULT.
+ .PP
+ The type of mutex is contained in the \fItype\fR attribute of the
+ mutex attributes. Valid mutex types include:
+ .Ip "\s-1PTHREAD_MUTEX_NORMAL\s0" 4
+ This type of mutex does not detect deadlock. A thread
+ attempting to relock this mutex without first unlocking it
+ will deadlock. Attempting to unlock a
+ mutex locked by a different thread results in undefined behaviour.
+ Attempting to unlock an unlocked
+ mutex results in undefined behaviour.
+ .Ip "\s-1PTHREAD_MUTEX_ERRORCHECK\s0" 4
+ This type of mutex provides error checking. A thread
+ attempting to relock this mutex without first unlocking it
+ will return with an error.
+ A thread attempting to unlock a mutex which another
+ thread has locked will return with an error.
+ A thread attempting to unlock an unlocked mutex will
+ return with an error.
+ .Ip "\s-1PTHREAD_MUTEX_RECURSIVE\s0" 4
+ A thread attempting to relock this mutex without first
+ unlocking it will succeed in locking the mutex. The relocking
+ deadlock which can occur with
+ mutexes of type \s-1PTHREAD_MUTEX_NORMAL\s0 cannot occur with this type
+ of mutex. Multiple
+ locks of this mutex require the same number of unlocks to release
+ the mutex before another thread
+ can acquire the mutex.
+ A thread attempting to unlock a mutex which another thread has
+ locked will return with an error. A thread attempting to
+ unlock an unlocked mutex will return with an error.
+ .Ip "\s-1PTHREAD_MUTEX_DEFAULT\s0" 4
+ Attempting to recursively lock a mutex of this type results in
+ undefined behaviour. Attempting to unlock a mutex of this type which
+ was not locked by the calling
+ thread results in undefined behaviour. Attempting to unlock a mutex
+ of this type which is not locked results in undefined behaviour.
+ An implementation is allowed to map this mutex to one of the
+ other mutex types.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutexattr_settype()\fR
+ function
+ returns zero. Otherwise, an error number is
+ returned to indicate the error.
+ .PP
+ Upon successful completion, the
+ \fIpthread_mutexattr_gettype()\fR
+ function returns zero and stores the value of the
+ \fItype\fR attribute of \fIattr\fR into the object referenced by the
+ \fItype\fR
+ parameter. Otherwise an error is returned to indicate
+ the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_gettype()\fR
+ and
+ \fIpthread_mutexattr_settype()\fR
+ functions will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value \fItype\fR is invalid.
+ .PP
+ The
+ \fIpthread_mutexattr_gettype()\fR
+ and
+ \fIpthread_mutexattr_settype()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ It is advised that an application should not use
+ a PTHREAD_MUTEX_RECURSIVE mutex with condition variables
+ because the implicit unlock performed for a
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ may not actually release the
+ mutex (if it had been locked multiple times). If this happens,
+ no other thread can satisfy the condition of the predicate.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_cond_timedwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_init,\fR \fBpthread_mutexattr_destroy\fR
+ \- initialise and destroy mutex attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_init\fR\|(pthread_mutexattr_t *\fIattr\fR);
+ int \fIpthread_mutexattr_destroy\fR\|(pthread_mutexattr_t *\fIattr\fR);
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_mutexattr_init()\fR
+ initialises a mutex attributes object
+ \fIattr\fR
+ with the default value for all of the attributes
+ defined by the implementation.
+ .PP
+ The effect of initialising an already initialised mutex
+ attributes object is undefined.
+ .PP
+ After a mutex attributes object has been used
+ to initialise one or more mutexes,
+ any function affecting the attributes object (including destruction)
+ does not affect any previously initialised mutexes.
+ .PP
+ The
+ \fIpthread_mutexattr_destroy()\fR
+ function destroys a mutex attributes object;
+ the object becomes, in effect, uninitialised.
+ An implementation may cause
+ \fIpthread_mutexattr_destroy()\fR
+ to set the object referenced by
+ \fIattr\fR
+ to an invalid value.
+ A destroyed mutex attributes object
+ can be re-initialised using
+ \fIpthread_mutexattr_init()\fR;
+ the results of otherwise referencing the object after it has been
+ destroyed are undefined.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_mutexattr_init()\fR
+ and
+ \fIpthread_mutexattr_destroy()\fR
+ return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_init()\fR
+ function may fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the mutex attributes object.
+ .PP
+ The
+ \fIpthread_mutexattr_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutexattr_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_setprioceiling,\fR \fBpthread_mutexattr_getprioceiling\fR
+ \- set and get prioceiling attribute of mutex attribute object
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_setprioceiling\fR\|(pthread_mutexattr_t *\fIattr\fR,
+ int \fIprioceiling\fR);
+ int \fIpthread_mutexattr_getprioceiling\fR\|(const pthread_mutexattr_t *\fIattr\fR,
+ int *\fIprioceiling\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions, respectively, set and get the priority ceiling attribute of
+ a mutex attribute object pointed to by
+ \fIattr\fR
+ which was previously created by the function
+ \fIpthread_mutexattr_init()\fR.
+ .PP
+ The
+ \fIprioceiling\fR
+ attribute contains the priority ceiling of initialised mutexes.
+ The values of
+ \fIprioceiling\fR
+ will be within the maximum range of priorities defined by SCHED_FIFO.
+ .PP
+ The
+ \fIprioceiling\fR
+ attribute defines the priority ceiling of initialised mutexes,
+ which is the minimum priority level
+ at which the critical section guarded by the mutex is executed.
+ In order to avoid priority inversion,
+ the priority ceiling of the mutex will be set to a priority
+ higher than or equal to the highest priority of all the threads
+ that may lock that mutex.
+ The values of
+ \fIprioceiling\fR
+ will be within the maximum range of priorities
+ defined under the SCHED_FIFO scheduling policy.
+ .SH "RETURN VALUE"
+ Upon successful completion, the
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIO_PROTECT is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_mutexattr_setprioceiling()\fR
+ and
+ \fIpthread_mutexattr_getprioceiling()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ or
+ \fIprioceiling\fR
+ is invalid.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_setprotocol,\fR \fBpthread_mutexattr_getprotocol\fR
+ \- set and get protocol attribute of mutex attribute object
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_setprotocol\fR\|(pthread_mutexattr_t *\fIattr\fR,
+ int \fIprotocol\fR);
+ int \fIpthread_mutexattr_getprotocol\fR\|(const pthread_mutexattr_t *\fIattr\fR,
+ int *\fIprotocol\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions, respectively, set and get the protocol attribute of a mutex
+ attribute object pointed to by
+ \fIattr\fR
+ which was previously created by the function
+ \fIpthread_mutexattr_init()\fR.
+ .PP
+ The
+ \fIprotocol\fR
+ attribute defines the protocol to be followed in utilising mutexes.
+ The value of
+ \fIprotocol\fR
+ may be one of PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT or
+ PTHREAD_PRIO_PROTECT, which are defined by the header
+ \fI<pthread.h\fR>.
+ .PP
+ When a thread owns a mutex with the PTHREAD_PRIO_NONE
+ protocol attribute, its priority and scheduling are not affected
+ by its mutex ownership.
+ .PP
+ When a thread is blocking higher priority threads because of owning one or
+ more mutexes with the PTHREAD_PRIO_INHERIT
+ protocol attribute, it executes at the higher of its priority
+ or the priority of the highest priority thread waiting on any of the mutexes
+ owned by this thread and initialised with this protocol.
+ .PP
+ When a thread owns one or more mutexes initialised with the
+ PTHREAD_PRIO_PROTECT
+ protocol, it executes at the higher of its priority or the highest
+ of the priority ceilings of all the mutexes
+ owned by this thread and initialised with this attribute,
+ regardless of whether other threads are blocked on any of these
+ mutexes or not.
+ .PP
+ While a thread is holding a mutex which has been initialised with the
+ PRIO_INHERIT or PRIO_PROTECT protocol attributes,
+ it will not be subject to being moved
+ to the tail of the scheduling queue at its priority
+ in the event that its original priority is changed,
+ such as by a call to
+ \fIsched_setparam()\fR.
+ Likewise,
+ when a thread unlocks a mutex that has been initialised with the
+ PRIO_INHERIT or PRIO_PROTECT protocol attributes,
+ it will not be subject to being moved
+ to the tail of the scheduling queue at its priority
+ in the event that its original priority is changed.
+ .PP
+ If a thread simultaneously owns several mutexes
+ initialised with different protocols,
+ it will execute at the highest of the priorities
+ that it would have obtained by each of these protocols.
+ .PP
+ When a thread makes a call to
+ \fIpthread_mutex_lock()\fR,
+ if the symbol _POSIX_THREAD_PRIO_INHERIT
+ is defined and the mutex was
+ initialised with the protocol attribute having the value
+ PTHREAD_PRIO_INHERIT, when the calling thread is blocked
+ because the mutex is owned by another thread,
+ that owner thread will inherit the priority level
+ of the calling thread as long as it continues to own the mutex.
+ The implementation updates its execution priority
+ to the maximum of its assigned priority and all its inherited priorities.
+ Furthermore, if this owner thread itself becomes blocked on another mutex,
+ the same priority inheritance effect will be propagated
+ to this other owner thread, in a recursive manner.
+ .SH "RETURN VALUE"
+ Upon successful completion, the
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ Neither one of the options _POSIX_THREAD_PRIO_PROTECT and
+ _POSIX_THREAD_PRIO_INHERIT is defined and the implementation does not
+ support the function.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ The value specified by
+ \fIprotocol\fR
+ is an unsupported value.
+ .PP
+ The
+ \fIpthread_mutexattr_setprotocol()\fR
+ and
+ \fIpthread_mutexattr_getprotocol()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ ro
+ \fIprotocol\fR
+ is invalid.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_getpshared,\fR \fBpthread_mutexattr_setpshared\fR
+ \- set and get process-shared attribute
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_getpshared\fR\|(const pthread_mutexattr_t *\fIattr\fR,
+ int *\fIpshared\fR);
+ int \fIpthread_mutexattr_setpshared\fR\|(pthread_mutexattr_t *\fIattr\fR,
+ int \fIpshared\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_getpshared()\fR
+ function obtains the value of the
+ \fIprocess-shared\fR
+ attribute from the attributes object referenced by
+ \fIattr\fR.
+ The
+ \fIpthread_mutexattr_setpshared()\fR
+ function is used to set the
+ \fIprocess-shared\fR
+ attribute in an initialised attributes object referenced by
+ \fIattr\fR.
+ .PP
+ The
+ \fIprocess-shared\fR
+ attribute is set to PTHREAD_PROCESS_SHARED to permit a mutex
+ to be operated upon by any thread that has access to the memory
+ where the mutex is allocated, even if the mutex
+ is allocated in memory that is shared by multiple processes.
+ If the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE, the mutex will only be operated upon
+ by threads created within the same process as the thread
+ that initialised the mutex;
+ if threads of differing processes attempt to operate on such a mutex,
+ the behaviour is undefined.
+ The default value of the attribute is
+ PTHREAD_PROCESS_PRIVATE.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_mutexattr_setpshared()\fR
+ returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ Upon successful completion,
+ \fIpthread_mutexattr_getpshared()\fR
+ returns zero and stores the value of the
+ \fIprocess-shared\fR
+ attribute of
+ \fIattr\fR
+ into the object referenced by the
+ \fIpshared\fR
+ parameter.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_getpshared()\fR
+ and
+ \fIpthread_mutexattr_setpshared()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIattr\fR
+ is invalid.
+ .PP
+ The
+ \fIpthread_mutexattr_setpshared()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The new value specified for the attribute
+ is outside the range of legal values for that attribute.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_mutex_init()\fR,
+ \fIpthread_mutexattr_init()\fR,
+ \fIpthread_cond_init()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_mutexattr_gettype,\fR \fBpthread_mutexattr_settype\fR
+ \- get or set a mutex type
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_mutexattr_gettype\fR\|(const pthread_mutexattr_t \fI*attr\fR, int \fI*type\fR);
+ int \fIpthread_mutexattr_settype\fR\|(pthread_mutexattr_t \fI*attr\fR, int \fItype\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_mutexattr_gettype()\fR
+ and
+ \fIpthread_mutexattr_settype()\fR
+ functions respectively get and set the mutex \fItype\fR attribute.
+ This attribute is set in the \fItype\fR parameter
+ to these functions. The default value of the \fItype\fR
+ attribute is PTHREAD_MUTEX_DEFAULT.
+ .PP
+ The type of mutex is contained in the \fItype\fR attribute of the
+ mutex attributes. Valid mutex types include:
+ .Ip "\s-1PTHREAD_MUTEX_NORMAL\s0" 4
+ This type of mutex does not detect deadlock. A thread
+ attempting to relock this mutex without first unlocking it
+ will deadlock. Attempting to unlock a
+ mutex locked by a different thread results in undefined behaviour.
+ Attempting to unlock an unlocked
+ mutex results in undefined behaviour.
+ .Ip "\s-1PTHREAD_MUTEX_ERRORCHECK\s0" 4
+ This type of mutex provides error checking. A thread
+ attempting to relock this mutex without first unlocking it
+ will return with an error.
+ A thread attempting to unlock a mutex which another
+ thread has locked will return with an error.
+ A thread attempting to unlock an unlocked mutex will
+ return with an error.
+ .Ip "\s-1PTHREAD_MUTEX_RECURSIVE\s0" 4
+ A thread attempting to relock this mutex without first
+ unlocking it will succeed in locking the mutex. The relocking
+ deadlock which can occur with
+ mutexes of type \s-1PTHREAD_MUTEX_NORMAL\s0 cannot occur with this type
+ of mutex. Multiple
+ locks of this mutex require the same number of unlocks to release
+ the mutex before another thread
+ can acquire the mutex.
+ A thread attempting to unlock a mutex which another thread has
+ locked will return with an error. A thread attempting to
+ unlock an unlocked mutex will return with an error.
+ .Ip "\s-1PTHREAD_MUTEX_DEFAULT\s0" 4
+ Attempting to recursively lock a mutex of this type results in
+ undefined behaviour. Attempting to unlock a mutex of this type which
+ was not locked by the calling
+ thread results in undefined behaviour. Attempting to unlock a mutex
+ of this type which is not locked results in undefined behaviour.
+ An implementation is allowed to map this mutex to one of the
+ other mutex types.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_mutexattr_settype()\fR
+ function
+ returns zero. Otherwise, an error number is
+ returned to indicate the error.
+ .PP
+ Upon successful completion, the
+ \fIpthread_mutexattr_gettype()\fR
+ function returns zero and stores the value of the
+ \fItype\fR attribute of \fIattr\fR into the object referenced by the
+ \fItype\fR
+ parameter. Otherwise an error is returned to indicate
+ the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_mutexattr_gettype()\fR
+ and
+ \fIpthread_mutexattr_settype()\fR
+ functions will fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value \fItype\fR is invalid.
+ .PP
+ The
+ \fIpthread_mutexattr_gettype()\fR
+ and
+ \fIpthread_mutexattr_settype()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ It is advised that an application should not use
+ a PTHREAD_MUTEX_RECURSIVE mutex with condition variables
+ because the implicit unlock performed for a
+ \fIpthread_cond_wait()\fR
+ or
+ \fIpthread_cond_timedwait()\fR
+ may not actually release the
+ mutex (if it had been locked multiple times). If this happens,
+ no other thread can satisfy the condition of the predicate.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cond_wait()\fR,
+ \fIpthread_cond_timedwait()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_once\fR \- dynamic package initialisation
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_once\fR\|(pthread_once_t *\fIonce_control\fR,
+ void (*\fIinit_routine\fR)(void));
+ pthread_once_t \fIonce_control\fR = PTHREAD_ONCE_INIT;
+ .SH "DESCRIPTION"
+ The first call to
+ \fIpthread_once()\fR
+ by any thread in a process, with a given
+ \fIonce_control\fR,
+ will call the
+ \fIinit_routine()\fR
+ with no arguments.
+ Subsequent calls of
+ \fIpthread_once()\fR
+ with the same
+ \fIonce_control\fR
+ will not call the
+ \fIinit_routine()\fR.
+ On return from
+ \fIpthread_once()\fR,
+ it is guaranteed that
+ \fIinit_routine()\fR
+ has completed.
+ The
+ \fIonce_control\fR
+ parameter is used to determine whether
+ the associated initialisation routine has been called.
+ .PP
+ The function
+ \fIpthread_once()\fR
+ is not a cancellation point.
+ However, if
+ \fIinit_routine()\fR
+ is a cancellation point and is canceled,
+ the effect on
+ \fIonce_control\fR
+ is as if
+ \fIpthread_once()\fR
+ was never called.
+ .PP
+ The constant PTHREAD_ONCE_INIT
+ is defined by the header
+ \fI<pthread.h\fR>.
+ .PP
+ The behaviour of
+ \fIpthread_once()\fR
+ is undefined if
+ \fIonce_control\fR
+ has automatic storage duration or is not initialised by
+ PTHREAD_ONCE_INIT.
+ .SH "RETURN VALUE"
+ Upon successful completion,
+ \fIpthread_once()\fR
+ returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ The
+ \fIpthread_once()\fR
+ function will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread,h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlock_init,\fR \fBpthread_rwlock_destroy\fR
+ \- initialise or destroy a read-write lock object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlock_init\fR\|(pthread_rwlock_t *rwlock,
+ const pthread_rwlockattr_t \fI*attr\fR);
+ int \fIpthread_rwlock_destroy\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ pthread_rwlock_t \fIrwlock\fR=PTHREAD_RWLOCK_INITIALIZER;
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_rwlock_init()\fR
+ function initialises the read-write lock referenced by \fIrwlock\fR with
+ the attributes referenced by \fIattr\fR. If \fIattr\fR is NULL, the
+ default
+ read-write lock attributes are used; the effect is the same as
+ passing the address of a default read-write lock attributes object.
+ Once initialised, the lock can be used any
+ number of times without being re-initialised.
+ Upon successful initialisation, the state of the read-write lock
+ becomes initialised and unlocked.
+ Results are undefined if
+ \fIpthread_rwlock_init()\fR
+ is called specifying an already initialised read-write lock.
+ Results are undefined if a read-write lock is used without first being
+ initialised.
+ .PP
+ If the
+ \fIpthread_rwlock_init()\fR
+ function fails, \fIrwlock\fR is not initialised and the contents of
+ \fIrwlock\fR are undefined.
+ .PP
+ The
+ \fIpthread_rwlock_destroy()\fR
+ function destroys the read-write lock object referenced by \fIrwlock\fR
+ and
+ releases any resources used by the lock.
+ The effect of subsequent use of the lock is undefined until the lock
+ is re-initialised by another call to
+ \fIpthread_rwlock_init()\fR.
+ An implementation may cause
+ \fIpthread_rwlock_destroy()\fR
+ to set the object referenced by \fIrwlock\fR to an invalid value.
+ Results are undefined if
+ \fIpthread_rwlock_destroy()\fR
+ is called when any thread holds \fIrwlock\fR.
+ Attempting to destroy an uninitialised
+ read-write lock results in undefined behaviour.
+ A destroyed read-write lock object can be re-initialised using
+ \fIpthread_rwlock_init()\fR;
+ the results of otherwise referencing the read-write lock object after it
+ has been destroyed are undefined.
+ .PP
+ In cases where default read-write lock attributes are appropriate, the
+ macro PTHREAD_RWLOCK_INITIALIZER can be used to initialise read-write locks
+ that are statically allocated.
+ The effect is equivalent to dynamic initialisation by a call to
+ \fIpthread_rwlock_init()\fR
+ with the parameter \fIattr\fR specified as NULL, except that no error
+ checks are performed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlock_init()\fR
+ and
+ \fIpthread_rwlock_destroy()\fR
+ functions return zero. Otherwise, an
+ error number is returned to indicate the error.
+ The [EBUSY] and [EINVAL] error checks, if implemented, will
+ act as if they were performed immediately at the beginning of processing
+ for the function and caused an error return
+ prior to modifying the state of the read-write lock specified by
+ \fIrwlock\fR.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlock_init()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources (other than memory)
+ to initialise another read-write lock.
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the read-write lock.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .PP
+ The
+ \fIpthread_rwlock_init()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to re-initialise the
+ object referenced by \fIrwlock\fR, a previously initialised but
+ not yet destroyed read-write lock.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .PP
+ The
+ \fIpthread_rwlock_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to destroy the
+ object referenced by \fIrwlock\fR while it is locked.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_rdlock()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fIpthread_rwlock_unlock()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlock_init,\fR \fBpthread_rwlock_destroy\fR
+ \- initialise or destroy a read-write lock object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlock_init\fR\|(pthread_rwlock_t *rwlock,
+ const pthread_rwlockattr_t \fI*attr\fR);
+ int \fIpthread_rwlock_destroy\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ pthread_rwlock_t \fIrwlock\fR=PTHREAD_RWLOCK_INITIALIZER;
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_rwlock_init()\fR
+ function initialises the read-write lock referenced by \fIrwlock\fR with
+ the attributes referenced by \fIattr\fR. If \fIattr\fR is NULL, the
+ default
+ read-write lock attributes are used; the effect is the same as
+ passing the address of a default read-write lock attributes object.
+ Once initialised, the lock can be used any
+ number of times without being re-initialised.
+ Upon successful initialisation, the state of the read-write lock
+ becomes initialised and unlocked.
+ Results are undefined if
+ \fIpthread_rwlock_init()\fR
+ is called specifying an already initialised read-write lock.
+ Results are undefined if a read-write lock is used without first being
+ initialised.
+ .PP
+ If the
+ \fIpthread_rwlock_init()\fR
+ function fails, \fIrwlock\fR is not initialised and the contents of
+ \fIrwlock\fR are undefined.
+ .PP
+ The
+ \fIpthread_rwlock_destroy()\fR
+ function destroys the read-write lock object referenced by \fIrwlock\fR
+ and
+ releases any resources used by the lock.
+ The effect of subsequent use of the lock is undefined until the lock
+ is re-initialised by another call to
+ \fIpthread_rwlock_init()\fR.
+ An implementation may cause
+ \fIpthread_rwlock_destroy()\fR
+ to set the object referenced by \fIrwlock\fR to an invalid value.
+ Results are undefined if
+ \fIpthread_rwlock_destroy()\fR
+ is called when any thread holds \fIrwlock\fR.
+ Attempting to destroy an uninitialised
+ read-write lock results in undefined behaviour.
+ A destroyed read-write lock object can be re-initialised using
+ \fIpthread_rwlock_init()\fR;
+ the results of otherwise referencing the read-write lock object after it
+ has been destroyed are undefined.
+ .PP
+ In cases where default read-write lock attributes are appropriate, the
+ macro PTHREAD_RWLOCK_INITIALIZER can be used to initialise read-write locks
+ that are statically allocated.
+ The effect is equivalent to dynamic initialisation by a call to
+ \fIpthread_rwlock_init()\fR
+ with the parameter \fIattr\fR specified as NULL, except that no error
+ checks are performed.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlock_init()\fR
+ and
+ \fIpthread_rwlock_destroy()\fR
+ functions return zero. Otherwise, an
+ error number is returned to indicate the error.
+ The [EBUSY] and [EINVAL] error checks, if implemented, will
+ act as if they were performed immediately at the beginning of processing
+ for the function and caused an error return
+ prior to modifying the state of the read-write lock specified by
+ \fIrwlock\fR.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlock_init()\fR
+ function will fail if:
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The system lacked the necessary resources (other than memory)
+ to initialise another read-write lock.
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the read-write lock.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the privilege to perform the operation.
+ .PP
+ The
+ \fIpthread_rwlock_init()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to re-initialise the
+ object referenced by \fIrwlock\fR, a previously initialised but
+ not yet destroyed read-write lock.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .PP
+ The
+ \fIpthread_rwlock_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The implementation has detected an attempt to destroy the
+ object referenced by \fIrwlock\fR while it is locked.
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_rdlock()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fIpthread_rwlock_unlock()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlock_rdlock,\fR \fBpthread_rwlock_tryrdlock\fR
+ \- lock a read-write lock object for reading
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlock_rdlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ int \fIpthread_rwlock_tryrdlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_rwlock_rdlock()\fR
+ function applies a read lock to the read-write lock referenced by
+ \fIrwlock\fR.
+ The calling thread acquires the read lock if a writer does not
+ hold the lock and there are no writers blocked
+ on the lock. It is unspecified whether the calling thread
+ acquires the lock when a writer does not hold the lock
+ and there are writers waiting for the lock. If a writer holds
+ the lock, the calling thread will not acquire the
+ read lock. If the read lock is not acquired, the calling
+ thread blocks (that is, it does not return from the
+ \fIpthread_rwlock_rdlock()\fR
+ call) until it can acquire the lock.
+ Results are undefined if the calling thread holds
+ a write lock on \fIrwlock\fR
+ at the time the call is made.
+ .PP
+ Implementations are allowed to favour writers over readers
+ to avoid writer starvation.
+ .PP
+ A thread may hold multiple concurrent read locks on \fIrwlock\fR
+ (that is, successfully call the
+ \fIpthread_rwlock_rdlock()\fR
+ function \fIn\fR times). If so, the thread
+ must perform matching unlocks (that is, it must
+ call the
+ \fIpthread_rwlock_unlock()\fR
+ function \fIn\fR times).
+ .PP
+ The function
+ \fIpthread_rwlock_tryrdlock()\fR
+ applies a read lock
+ as in the
+ \fIpthread_rwlock_rdlock()\fR
+ function
+ with the exception that the function fails if any thread holds a
+ write lock on \fIrwlock\fR or there are writers blocked
+ on \fIrwlock\fR.
+ .PP
+ Results are undefined if any of these functions are called with
+ an uninitialised read-write lock.
+ .PP
+ If a signal is delivered to a thread waiting for a read-write
+ lock for reading, upon return from the signal handler
+ the thread resumes waiting for the read-write lock for
+ reading as if it was not interrupted.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlock_rdlock()\fR
+ function returns zero.
+ Otherwise, an error number is returned
+ to indicate the error.
+ .PP
+ The function
+ \fIpthread_rwlock_tryrdlock()\fR
+ returns zero if the
+ lock for reading on the read-write lock object
+ referenced by \fIrwlock\fR is acquired.
+ Otherwise an error number
+ is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlock_tryrdlock()\fR
+ function will fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The read-write lock could not be acquired for reading because a
+ writer holds the
+ lock or was blocked on it.
+ .PP
+ The
+ \fIpthread_rwlock_rdlock()\fR
+ and
+ \fIpthread_rwlock_tryrdlock()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIrwlock\fR does not refer to an initialised
+ read-write lock object.
+ .Ip "[\s-1EDEADLK\s0]" 4
+ The current thread already owns the read-write lock for writing.
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The read lock could not be acquired because the maximum number of
+ read locks
+ for \fIrwlock\fR has been exceeded.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .PP
+ Realtime applications may encounter priority inversion when using
+ read-write locks.
+ The problem occurs when a high priority thread "locks" a read-write
+ lock that is about to be "unlocked" by a low priority thread, but
+ the low priority thread is preempted by a medium priority thread.
+ This scenario leads to priority inversion; a high priority thread is
+ blocked by lower priority threads for an unlimited period of time.
+ During system design, realtime programmers must take into account the
+ possibility of this kind of priority inversion.
+ They can deal with it in a number of ways, such as by having critical
+ sections that are guarded by read-write locks execute at a high
+ priority, so that a thread cannot be preempted while executing in its
+ critical section.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fIpthread_rwlock_unlock()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlock_rdlock,\fR \fBpthread_rwlock_tryrdlock\fR
+ \- lock a read-write lock object for reading
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlock_rdlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ int \fIpthread_rwlock_tryrdlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_rwlock_rdlock()\fR
+ function applies a read lock to the read-write lock referenced by
+ \fIrwlock\fR.
+ The calling thread acquires the read lock if a writer does not
+ hold the lock and there are no writers blocked
+ on the lock. It is unspecified whether the calling thread
+ acquires the lock when a writer does not hold the lock
+ and there are writers waiting for the lock. If a writer holds
+ the lock, the calling thread will not acquire the
+ read lock. If the read lock is not acquired, the calling
+ thread blocks (that is, it does not return from the
+ \fIpthread_rwlock_rdlock()\fR
+ call) until it can acquire the lock.
+ Results are undefined if the calling thread holds
+ a write lock on \fIrwlock\fR
+ at the time the call is made.
+ .PP
+ Implementations are allowed to favour writers over readers
+ to avoid writer starvation.
+ .PP
+ A thread may hold multiple concurrent read locks on \fIrwlock\fR
+ (that is, successfully call the
+ \fIpthread_rwlock_rdlock()\fR
+ function \fIn\fR times). If so, the thread
+ must perform matching unlocks (that is, it must
+ call the
+ \fIpthread_rwlock_unlock()\fR
+ function \fIn\fR times).
+ .PP
+ The function
+ \fIpthread_rwlock_tryrdlock()\fR
+ applies a read lock
+ as in the
+ \fIpthread_rwlock_rdlock()\fR
+ function
+ with the exception that the function fails if any thread holds a
+ write lock on \fIrwlock\fR or there are writers blocked
+ on \fIrwlock\fR.
+ .PP
+ Results are undefined if any of these functions are called with
+ an uninitialised read-write lock.
+ .PP
+ If a signal is delivered to a thread waiting for a read-write
+ lock for reading, upon return from the signal handler
+ the thread resumes waiting for the read-write lock for
+ reading as if it was not interrupted.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlock_rdlock()\fR
+ function returns zero.
+ Otherwise, an error number is returned
+ to indicate the error.
+ .PP
+ The function
+ \fIpthread_rwlock_tryrdlock()\fR
+ returns zero if the
+ lock for reading on the read-write lock object
+ referenced by \fIrwlock\fR is acquired.
+ Otherwise an error number
+ is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlock_tryrdlock()\fR
+ function will fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The read-write lock could not be acquired for reading because a
+ writer holds the
+ lock or was blocked on it.
+ .PP
+ The
+ \fIpthread_rwlock_rdlock()\fR
+ and
+ \fIpthread_rwlock_tryrdlock()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIrwlock\fR does not refer to an initialised
+ read-write lock object.
+ .Ip "[\s-1EDEADLK\s0]" 4
+ The current thread already owns the read-write lock for writing.
+ .Ip "[\s-1EAGAIN\s0]" 4
+ The read lock could not be acquired because the maximum number of
+ read locks
+ for \fIrwlock\fR has been exceeded.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .PP
+ Realtime applications may encounter priority inversion when using
+ read-write locks.
+ The problem occurs when a high priority thread "locks" a read-write
+ lock that is about to be "unlocked" by a low priority thread, but
+ the low priority thread is preempted by a medium priority thread.
+ This scenario leads to priority inversion; a high priority thread is
+ blocked by lower priority threads for an unlimited period of time.
+ During system design, realtime programmers must take into account the
+ possibility of this kind of priority inversion.
+ They can deal with it in a number of ways, such as by having critical
+ sections that are guarded by read-write locks execute at a high
+ priority, so that a thread cannot be preempted while executing in its
+ critical section.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fIpthread_rwlock_unlock()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlock_wrlock,\fR \fBpthread_rwlock_trywrlock\fR
+ \- lock a read-write lock object for writing
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlock_wrlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ int \fIpthread_rwlock_trywrlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_rwlock_wrlock()\fR
+ function applies a write lock to
+ the read-write lock referenced by \fIrwlock\fR. The
+ calling thread acquires the write lock if no other thread
+ (reader or writer) holds the read-write lock \fIrwlock\fR.
+ Otherwise, the thread blocks (that is, does not return from the
+ \fIpthread_rwlock_wrlock()\fR
+ call) until it can
+ acquire the lock. Results are undefined if the calling thread
+ holds the read-write lock (whether a read or write
+ lock) at the time the call is made.
+ .PP
+ Implementations are allowed to favour writers over
+ readers to avoid writer starvation.
+ .PP
+ The function
+ \fIpthread_rwlock_trywrlock()\fR
+ applies a write lock
+ like the
+ \fIpthread_rwlock_wrlock()\fR
+ function, with the exception that the function fails if any
+ thread currently holds \fIrwlock\fR (for reading or writing).
+ .PP
+ Results are undefined if any of these functions are called with
+ an uninitialised read-write lock.
+ .PP
+ If a signal is delivered to a thread waiting for a read-write
+ lock for writing, upon return from the signal handler
+ the thread resumes waiting for the read-write lock for
+ writing as if it was not interrupted.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlock_wrlock()\fR
+ function returns zero.
+ Otherwise, an error number is returned
+ to indicate the error.
+ .PP
+ The function
+ \fIpthread_rwlock_trywrlock()\fR
+ returns zero if the
+ lock for writing on the read-write lock object
+ referenced by \fIrwlock\fR is acquired.
+ Otherwise an error number is
+ returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlock_trywrlock()\fR
+ function will fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The read-write lock could not be acquired for writing because it
+ was already locked for reading or writing.
+ .PP
+ The
+ \fIpthread_rwlock_wrlock()\fR
+ and
+ \fIpthread_rwlock_trywrlock()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIrwlock\fR does not refer to an initialised
+ read-write lock object.
+ .Ip "[\s-1EDEADLK\s0]" 4
+ The current thread already owns the read-write lock for writing or
+ reading.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .PP
+ Realtime applications may encounter priority inversion when using
+ read-write locks.
+ The problem occurs when a high priority thread "locks" a read-write
+ lock that is about to be "unlocked" by a low priority thread, but
+ the low priority thread is preempted by a medium priority thread.
+ This scenario leads to priority inversion; a high priority thread is
+ blocked by lower priority threads for an unlimited period of time.
+ During system design, realtime programmers must take into account the
+ possibility of this kind of priority inversion.
+ They can deal with it in a number of ways, such as by having critical
+ sections that are guarded by read-write locks execute at a high
+ priority, so that a thread cannot be preempted while executing in its
+ critical section.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_unlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fIpthread_rwlock_rdlock()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlock_unlock\fR \- unlock a read-write lock object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlock_unlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_rwlock_unlock()\fR
+ function is called to release a lock held on the read-write lock
+ object referenced by \fIrwlock\fR.
+ Results are undefined if the read-write lock \fIrwlock\fR is not
+ held by the calling thread.
+ .PP
+ If this function is called to release a read lock from the
+ read-write lock object and there are other read locks
+ currently held on this read-write lock object, the read-write
+ lock object remains in the read locked state.
+ If this function releases the calling thread's last read lock on this
+ read-write lock object, then the calling thread is no longer one of
+ the owners of the object.
+ If this function releases the last read lock for this read-write lock
+ object, the read-write lock object will be put in the unlocked state
+ with no owners.
+ .PP
+ If this function is called to release a write lock for this
+ read-write lock object, the read-write lock object will
+ be put in the unlocked state with no owners.
+ .PP
+ If the call to the
+ \fIpthread_rwlock_unlock()\fR
+ function results in
+ the read-write lock object becoming unlocked
+ and there are multiple threads waiting to acquire the read-write
+ lock object for writing, the scheduling policy
+ is used to determine which thread acquires the read-write
+ lock object for writing. If there are multiple
+ threads waiting to acquire the read-write lock object for reading,
+ the scheduling policy is used to determine
+ the order in which the waiting threads acquire the
+ read-write lock object for reading.
+ If there are multiple threads blocked on \fIrwlock\fR
+ for both read locks and write locks, it is
+ unspecified whether the readers acquire the lock first or whether
+ a writer acquires the lock first.
+ .PP
+ Results are undefined if any of these functions are called with
+ an uninitialised read-write lock.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlock_unlock()\fR
+ function returns zero.
+ Otherwise, an error number is returned
+ to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlock_unlock()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIrwlock\fR does not refer to an initialised
+ read-write lock object.
+ .Ip "[\s-1EPERM\s0]" 4
+ The current thread does not own the read-write lock.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fIpthread_rwlock_rdlock()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlock_wrlock,\fR \fBpthread_rwlock_trywrlock\fR
+ \- lock a read-write lock object for writing
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlock_wrlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ int \fIpthread_rwlock_trywrlock\fR\|(pthread_rwlock_t \fI*rwlock\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_rwlock_wrlock()\fR
+ function applies a write lock to
+ the read-write lock referenced by \fIrwlock\fR. The
+ calling thread acquires the write lock if no other thread
+ (reader or writer) holds the read-write lock \fIrwlock\fR.
+ Otherwise, the thread blocks (that is, does not return from the
+ \fIpthread_rwlock_wrlock()\fR
+ call) until it can
+ acquire the lock. Results are undefined if the calling thread
+ holds the read-write lock (whether a read or write
+ lock) at the time the call is made.
+ .PP
+ Implementations are allowed to favour writers over
+ readers to avoid writer starvation.
+ .PP
+ The function
+ \fIpthread_rwlock_trywrlock()\fR
+ applies a write lock
+ like the
+ \fIpthread_rwlock_wrlock()\fR
+ function, with the exception that the function fails if any
+ thread currently holds \fIrwlock\fR (for reading or writing).
+ .PP
+ Results are undefined if any of these functions are called with
+ an uninitialised read-write lock.
+ .PP
+ If a signal is delivered to a thread waiting for a read-write
+ lock for writing, upon return from the signal handler
+ the thread resumes waiting for the read-write lock for
+ writing as if it was not interrupted.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlock_wrlock()\fR
+ function returns zero.
+ Otherwise, an error number is returned
+ to indicate the error.
+ .PP
+ The function
+ \fIpthread_rwlock_trywrlock()\fR
+ returns zero if the
+ lock for writing on the read-write lock object
+ referenced by \fIrwlock\fR is acquired.
+ Otherwise an error number is
+ returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlock_trywrlock()\fR
+ function will fail if:
+ .Ip "[\s-1EBUSY\s0]" 4
+ The read-write lock could not be acquired for writing because it
+ was already locked for reading or writing.
+ .PP
+ The
+ \fIpthread_rwlock_wrlock()\fR
+ and
+ \fIpthread_rwlock_trywrlock()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIrwlock\fR does not refer to an initialised
+ read-write lock object.
+ .Ip "[\s-1EDEADLK\s0]" 4
+ The current thread already owns the read-write lock for writing or
+ reading.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .PP
+ Realtime applications may encounter priority inversion when using
+ read-write locks.
+ The problem occurs when a high priority thread "locks" a read-write
+ lock that is about to be "unlocked" by a low priority thread, but
+ the low priority thread is preempted by a medium priority thread.
+ This scenario leads to priority inversion; a high priority thread is
+ blocked by lower priority threads for an unlimited period of time.
+ During system design, realtime programmers must take into account the
+ possibility of this kind of priority inversion.
+ They can deal with it in a number of ways, such as by having critical
+ sections that are guarded by read-write locks execute at a high
+ priority, so that a thread cannot be preempted while executing in its
+ critical section.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_unlock()\fR,
+ \fIpthread_rwlockattr_init()\fR,
+ \fIpthread_rwlock_rdlock()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlockattr_init,\fR \fBpthread_rwlockattr_destroy\fR
+ \- initialise and destroy read-write lock attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlockattr_init\fR\|(pthread_rwlockattr_t \fI*attr\fR);
+ int \fIpthread_rwlockattr_destroy\fR\|(pthread_rwlockattr_t \fI*attr\fR);
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_rwlockattr_init()\fR
+ initialises a read-write
+ lock attributes object \fIattr\fR with the default
+ value for all of the attributes defined by the implementation.
+ .PP
+ Results are undefined if
+ \fIpthread_rwlockattr_init()\fR
+ is called
+ specifying an already initialised read-write lock
+ attributes object.
+ .PP
+ After a read-write lock attributes object has been used to
+ initialise one or more read-write locks, any function
+ affecting the attributes object (including destruction) does not
+ affect any previously initialised read-write locks.
+ .PP
+ The
+ \fIpthread_rwlockattr_destroy()\fR
+ function destroys a read-write
+ lock attributes object. The effect of
+ subsequent use of the object is undefined until the object is
+ re-initialised by another call to
+ \fIpthread_rwlockattr_init()\fR.
+ An implementation may cause
+ \fIpthread_rwlockattr_destroy()\fR
+ to set the object
+ referenced by attr to an invalid value.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlockattr_init()\fR
+ and
+ \fIpthread_rwlockattr_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to
+ indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlockattr_init()\fR
+ function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the read-write
+ lock attributes object.
+ .PP
+ The
+ \fIpthread_rwlockattr_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_unlock()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlock_rdlock()\fR,
+ \fIpthread_rwlockattr_getpshared()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlockattr_getpshared,\fR \fBpthread_rwlockattr_setpshared\fR
+ \- get and set process-shared attribute of read-write lock
+ attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlockattr_getpshared\fR\|(const pthread_rwlockattr_t \fI*attr\fR,
+ int \fI*pshared\fR);
+ int \fIpthread_rwlockattr_setpshared\fR\|(pthread_rwlockattr_t \fI*attr\fR,
+ int \fIpshared\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIprocess-shared\fR
+ attribute is set to PTHREAD_PROCESS_SHARED to
+ permit a read-write lock to be operated upon by any thread that
+ has access to the memory where the read-write lock is allocated,
+ even if the read-write lock is allocated
+ in memory that is shared by multiple processes.
+ If the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE, the
+ read-write lock will only be
+ operated upon by threads created within the same process as the
+ thread that initialised the read-write lock; if
+ threads of differing processes attempt to operate on such a
+ read-write lock, the behaviour is undefined. The
+ default value of the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE.
+ .PP
+ The
+ \fIpthread_rwlockattr_getpshared()\fR
+ function obtains the value of the
+ \fIprocess-shared\fR
+ attribute from the initialised attributes object referenced by \fIattr\fR.
+ The
+ \fIpthread_rwlockattr_setpshared()\fR
+ function is used to set the
+ \fIprocess-shared\fR
+ attribute in an initialised attributes object referenced by attr.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlockattr_setpshared()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ Upon successful completion, the
+ \fIpthread_rwlockattr_getpshared()\fR
+ returns zero and stores the value of the
+ \fIprocess-shared\fR
+ attribute of \fIattr\fR into the object referenced by the
+ \fIpshared\fR parameter. Otherwise an error number is
+ returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlockattr_getpshared()\fR
+ and
+ \fIpthread_rwlockattr_setpshared()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .PP
+ The
+ \fIpthread_rwlockattr_setpshared()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The new value specified for the attribute is outside the range
+ of legal values for
+ that attribute.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_unlock()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlock_rdlock()\fR,
+ \fIpthread_rwlockattr_init()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlockattr_init,\fR \fBpthread_rwlockattr_destroy\fR
+ \- initialise and destroy read-write lock attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlockattr_init\fR\|(pthread_rwlockattr_t \fI*attr\fR);
+ int \fIpthread_rwlockattr_destroy\fR\|(pthread_rwlockattr_t \fI*attr\fR);
+ .SH "DESCRIPTION"
+ The function
+ \fIpthread_rwlockattr_init()\fR
+ initialises a read-write
+ lock attributes object \fIattr\fR with the default
+ value for all of the attributes defined by the implementation.
+ .PP
+ Results are undefined if
+ \fIpthread_rwlockattr_init()\fR
+ is called
+ specifying an already initialised read-write lock
+ attributes object.
+ .PP
+ After a read-write lock attributes object has been used to
+ initialise one or more read-write locks, any function
+ affecting the attributes object (including destruction) does not
+ affect any previously initialised read-write locks.
+ .PP
+ The
+ \fIpthread_rwlockattr_destroy()\fR
+ function destroys a read-write
+ lock attributes object. The effect of
+ subsequent use of the object is undefined until the object is
+ re-initialised by another call to
+ \fIpthread_rwlockattr_init()\fR.
+ An implementation may cause
+ \fIpthread_rwlockattr_destroy()\fR
+ to set the object
+ referenced by attr to an invalid value.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlockattr_init()\fR
+ and
+ \fIpthread_rwlockattr_destroy()\fR
+ functions return zero.
+ Otherwise, an error number is returned to
+ indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlockattr_init()\fR
+ function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to initialise the read-write
+ lock attributes object.
+ .PP
+ The
+ \fIpthread_rwlockattr_destroy()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_unlock()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlock_rdlock()\fR,
+ \fIpthread_rwlockattr_getpshared()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_rwlockattr_getpshared,\fR \fBpthread_rwlockattr_setpshared\fR
+ \- get and set process-shared attribute of read-write lock
+ attributes object
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_rwlockattr_getpshared\fR\|(const pthread_rwlockattr_t \fI*attr\fR,
+ int \fI*pshared\fR);
+ int \fIpthread_rwlockattr_setpshared\fR\|(pthread_rwlockattr_t \fI*attr\fR,
+ int \fIpshared\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIprocess-shared\fR
+ attribute is set to PTHREAD_PROCESS_SHARED to
+ permit a read-write lock to be operated upon by any thread that
+ has access to the memory where the read-write lock is allocated,
+ even if the read-write lock is allocated
+ in memory that is shared by multiple processes.
+ If the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE, the
+ read-write lock will only be
+ operated upon by threads created within the same process as the
+ thread that initialised the read-write lock; if
+ threads of differing processes attempt to operate on such a
+ read-write lock, the behaviour is undefined. The
+ default value of the
+ \fIprocess-shared\fR
+ attribute is PTHREAD_PROCESS_PRIVATE.
+ .PP
+ The
+ \fIpthread_rwlockattr_getpshared()\fR
+ function obtains the value of the
+ \fIprocess-shared\fR
+ attribute from the initialised attributes object referenced by \fIattr\fR.
+ The
+ \fIpthread_rwlockattr_setpshared()\fR
+ function is used to set the
+ \fIprocess-shared\fR
+ attribute in an initialised attributes object referenced by attr.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_rwlockattr_setpshared()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .PP
+ Upon successful completion, the
+ \fIpthread_rwlockattr_getpshared()\fR
+ returns zero and stores the value of the
+ \fIprocess-shared\fR
+ attribute of \fIattr\fR into the object referenced by the
+ \fIpshared\fR parameter. Otherwise an error number is
+ returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_rwlockattr_getpshared()\fR
+ and
+ \fIpthread_rwlockattr_setpshared()\fR
+ functions may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by \fIattr\fR is invalid.
+ .PP
+ The
+ \fIpthread_rwlockattr_setpshared()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The new value specified for the attribute is outside the range
+ of legal values for
+ that attribute.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ Similar functions are being developed by IEEE PASC.
+ In keeping with its objective of ensuring that CAE
+ Specifications are fully aligned with formal standards, The Open Group
+ intends to add any new interfaces adopted by an official IEEE standard
+ in this area.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fI<pthread.h\fR>,
+ \fIpthread_rwlock_init()\fR,
+ \fIpthread_rwlock_unlock()\fR,
+ \fIpthread_rwlock_wrlock()\fR,
+ \fIpthread_rwlock_rdlock()\fR,
+ \fIpthread_rwlockattr_init()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_self\fR \- get calling thread's ID
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ pthread_t \fIpthread_self\fR\|(void);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_self()\fR
+ function returns the thread ID of the calling thread.
+ .SH "RETURN VALUE"
+ See DESCRIPTION above.
+ .SH "ERRORS"
+ No errors are defined.
+ .PP
+ The
+ \fIpthread_self()\fR
+ function will not return an error code of [EINTR].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_create()\fR,
+ \fIpthread_equal()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_setcancelstate,\fR \fBpthread_setcanceltype,\fR \fBpthread_testcancel\fR
+ \- set cancelability state
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_setcancelstate\fR\|(int \fIstate\fR, int *\fIoldstate\fR);
+ int \fIpthread_setcanceltype\fR\|(int \fItype\fR, int *\fIoldtype\fR);
+ void \fIpthread_testcancel\fR\|(void);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_setcancelstate()\fR
+ function atomically both sets the calling thread's cancelability
+ state to the indicated
+ \fIstate\fR
+ and returns the previous cancelability state
+ at the location referenced by \fIoldstate\fR.
+ Legal values for
+ \fIstate\fR
+ are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.
+ .PP
+ The
+ \fIpthread_setcanceltype()\fR
+ function atomically both sets the calling thread's cancelability
+ type to the indicated
+ \fItype\fR
+ and returns the previous cancelability type
+ at the location referenced by \fIoldtype\fR.
+ Legal values for
+ \fItype\fR
+ are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.
+ .PP
+ The cancelability state and type of any newly
+ created threads, including the thread in which
+ \fImain()\fR
+ was first invoked,
+ are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED
+ respectively.
+ .PP
+ The
+ \fIpthread_testcancel()\fR
+ function creates a cancellation point in the calling thread.
+ The
+ \fIpthread_testcancel()\fR
+ function has no effect if cancelability is disabled.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_setcancelstate()\fR
+ and
+ \fIpthread_setcanceltype()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_setcancelstate()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The specified state is not
+ \s-1PTHREAD_CANCEL_ENABLE\s0 or \s-1PTHREAD_CANCEL_DISABLE\s0.
+ .PP
+ The
+ \fIpthread_setcanceltype()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The specified type is not \s-1PTHREAD_CANCEL_DEFERRED\s0
+ or \s-1PTHREAD_CANCEL_ASYNCHRONOUS\s0.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cancel()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_setcancelstate,\fR \fBpthread_setcanceltype,\fR \fBpthread_testcancel\fR
+ \- set cancelability state
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_setcancelstate\fR\|(int \fIstate\fR, int *\fIoldstate\fR);
+ int \fIpthread_setcanceltype\fR\|(int \fItype\fR, int *\fIoldtype\fR);
+ void \fIpthread_testcancel\fR\|(void);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_setcancelstate()\fR
+ function atomically both sets the calling thread's cancelability
+ state to the indicated
+ \fIstate\fR
+ and returns the previous cancelability state
+ at the location referenced by \fIoldstate\fR.
+ Legal values for
+ \fIstate\fR
+ are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.
+ .PP
+ The
+ \fIpthread_setcanceltype()\fR
+ function atomically both sets the calling thread's cancelability
+ type to the indicated
+ \fItype\fR
+ and returns the previous cancelability type
+ at the location referenced by \fIoldtype\fR.
+ Legal values for
+ \fItype\fR
+ are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.
+ .PP
+ The cancelability state and type of any newly
+ created threads, including the thread in which
+ \fImain()\fR
+ was first invoked,
+ are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED
+ respectively.
+ .PP
+ The
+ \fIpthread_testcancel()\fR
+ function creates a cancellation point in the calling thread.
+ The
+ \fIpthread_testcancel()\fR
+ function has no effect if cancelability is disabled.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_setcancelstate()\fR
+ and
+ \fIpthread_setcanceltype()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_setcancelstate()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The specified state is not
+ \s-1PTHREAD_CANCEL_ENABLE\s0 or \s-1PTHREAD_CANCEL_DISABLE\s0.
+ .PP
+ The
+ \fIpthread_setcanceltype()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The specified type is not \s-1PTHREAD_CANCEL_DEFERRED\s0
+ or \s-1PTHREAD_CANCEL_ASYNCHRONOUS\s0.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cancel()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_setconcurrency\fR \- get or set level of concurrency
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_setconcurrency\fR\|(int \fInew_level\fR);
+ .SH "DESCRIPTION"
+ Refer to
+ \fIpthread_getconcurrency()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_getschedparam,\fR \fBpthread_setschedparam\fR
+ \- dynamic thread scheduling parameters access
+ (\fBREALTIME THREADS\fR)
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_getschedparam\fR\|(pthread_t \fIthread\fR, int *\fIpolicy\fR,
+ struct sched_param *\fIparam\fR);
+ int \fIpthread_setschedparam\fR\|(pthread_t \fIthread\fR, int \fIpolicy\fR,
+ const struct sched_param *\fIparam\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_getschedparam()\fR
+ and
+ \fIpthread_setschedparam()\fR
+ allow the scheduling policy and scheduling parameters of individual threads
+ within a multi-threaded process to be retrieved and set.
+ For SCHED_FIFO and SCHED_RR,
+ the only required member of the
+ \fBsched_param\fR
+ structure is the priority
+ \fIsched_priority\fR.
+ For SCHED_OTHER,
+ the affected scheduling parameters are implementation-dependent.
+ .PP
+ The
+ \fIpthread_getschedparam()\fR
+ function retrieves the scheduling policy and scheduling parameters
+ for the thread whose thread ID is given by
+ \fIthread\fR
+ and stores those values in
+ \fIpolicy\fR
+ and
+ \fIparam\fR,
+ respectively.
+ The priority value returned from
+ \fIpthread_getschedparam()\fR
+ is the value specified by the most recent
+ \fIpthread_setschedparam()\fR
+ or
+ \fIpthread_create()\fR
+ call affecting the target thread,
+ and reflects any temporary adjustments to its priority
+ as a result of any priority inheritance or ceiling functions.
+ The
+ \fIpthread_setschedparam()\fR
+ function sets the scheduling policy
+ and associated scheduling parameters for the thread whose
+ thread ID is given by
+ \fIthread\fR
+ to the policy and associated parameters provided in
+ \fIpolicy\fR
+ and
+ \fIparam\fR,
+ respectively.
+ .PP
+ The
+ \fIpolicy\fR
+ parameter may have the value SCHED_OTHER,
+ that has implementation-dependent scheduling parameters,
+ SCHED_FIFO or SCHED_RR,
+ that have the single scheduling parameter,
+ \fIpriority.\fR
+ .PP
+ If the
+ \fIpthread_setschedparam()\fR
+ function fails, no scheduling parameters will be changed
+ for the target thread.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_getschedparam()\fR
+ and
+ \fIpthread_setschedparam()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_getschedparam()\fR
+ and
+ \fIpthread_setschedparam()\fR
+ functions will fail if:
+ .Ip "[\s-1ENOSYS\s0]" 4
+ The option _POSIX_THREAD_PRIORITY_SCHEDULING is not defined and the
+ implementation does not support the function.
+ .PP
+ The
+ \fIpthread_getschedparam()\fR
+ function may fail if:
+ .Ip "[\s-1ESRCH\s0]" 4
+ The value specified by
+ \fIthread\fR
+ does not refer to a existing thread.
+ .PP
+ The
+ \fIpthread_setschedparam()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The value specified by
+ \fIpolicy\fR
+ or one of the scheduling parameters associated with
+ the scheduling policy
+ \fIpolicy\fR
+ is invalid.
+ .Ip "[\s-1ENOTSUP\s0]" 4
+ An attempt was made to set the policy or scheduling parameters to
+ an unsupported value.
+ .Ip "[\s-1EPERM\s0]" 4
+ The caller does not have the appropriate permission to set
+ either the scheduling parameters or the scheduling policy of the
+ specified thread.
+ .Ip "[\s-1EPERM\s0]" 4
+ The implementation does not allow the application to modify
+ one of the parameters to the value specified.
+ .Ip "[\s-1ESRCH\s0]" 4
+ The value specified by
+ \fIthread\fR
+ does not refer to a existing thread.
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIsched_setparam()\fR,
+ \fIsched_getparam()\fR,
+ \fIsched_setscheduler()\fR,
+ \fIsched_getscheduler()\fR,
+ \fI<pthread.h\fR>,
+ \fI<sched.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_setspecific,\fR \fBpthread_getspecific\fR \- thread-specific data management
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_setspecific\fR\|(pthread_key_t \fIkey\fR, const void *\fIvalue\fR);
+ void *\fIpthread_getspecific\fR\|(pthread_key_t \fIkey\fR);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_setspecific()\fR
+ function associates a thread-specific
+ \fIvalue\fR
+ with a
+ \fIkey\fR
+ obtained via a previous call to
+ \fIpthread_key_create()\fR.
+ Different threads may bind different values to the same key.
+ These values are typically pointers to blocks of dynamically allocated memory
+ that have been reserved for use by the calling thread.
+ .PP
+ The
+ \fIpthread_getspecific()\fR
+ function returns the value currently bound to the specified
+ \fIkey\fR
+ on behalf of the calling thread.
+ .PP
+ The effect of calling
+ \fIpthread_setspecific()\fR
+ or
+ \fIpthread_getspecific()\fR
+ with a
+ \fIkey\fR
+ value not obtained from
+ \fIpthread_key_create()\fR
+ or after
+ \fIkey\fR
+ has been deleted with
+ \fIpthread_key_delete()\fR
+ is undefined.
+ .PP
+ Both
+ \fIpthread_setspecific()\fR
+ and
+ \fIpthread_getspecific()\fR
+ may be called from a thread-specific data destructor function.
+ However, calling
+ \fIpthread_setspecific()\fR
+ from a destructor may result in lost storage or infinite loops.
+ .PP
+ Both functions may be implemented as macros.
+ .SH "RETURN VALUE"
+ The function
+ \fIpthread_getspecific()\fR
+ returns the thread-specific data value
+ associated with the given
+ \fIkey\fR.
+ If no thread-specific data value is associated with
+ \fIkey\fR,
+ then the value NULL is returned.
+ .PP
+ If successful, the
+ \fIpthread_setspecific()\fR
+ function returns zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_setspecific()\fR
+ function will fail if:
+ .Ip "[\s-1ENOMEM\s0]" 4
+ Insufficient memory exists to associate the value with the key.
+ .PP
+ The
+ \fIpthread_setspecific()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The key value is invalid.
+ .PP
+ No errors are returned from
+ \fIpthread_getspecific()\fR.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_key_create()\fR,
+ \fI<pthread.h\fR>.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_sigmask\fR \- examine and change blocked signals
+ .SH "SYNOPSIS"
+ #include <signal.h>
+ .PP
+ int \fIpthread_sigmask\fR\|(int \fIhow\fR, const sigset_t *\fIset\fR, sigset_t *\fIoset\fR);
+ .SH "DESCRIPTION"
+ Refer to
+ \fIsigprocmask()\fR.
+ .SH "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+ .SH "NAME"
+ \fBpthread_setcancelstate,\fR \fBpthread_setcanceltype,\fR \fBpthread_testcancel\fR
+ \- set cancelability state
+ .SH "SYNOPSIS"
+ #include <pthread.h>
+ .PP
+ int \fIpthread_setcancelstate\fR\|(int \fIstate\fR, int *\fIoldstate\fR);
+ int \fIpthread_setcanceltype\fR\|(int \fItype\fR, int *\fIoldtype\fR);
+ void \fIpthread_testcancel\fR\|(void);
+ .SH "DESCRIPTION"
+ The
+ \fIpthread_setcancelstate()\fR
+ function atomically both sets the calling thread's cancelability
+ state to the indicated
+ \fIstate\fR
+ and returns the previous cancelability state
+ at the location referenced by \fIoldstate\fR.
+ Legal values for
+ \fIstate\fR
+ are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.
+ .PP
+ The
+ \fIpthread_setcanceltype()\fR
+ function atomically both sets the calling thread's cancelability
+ type to the indicated
+ \fItype\fR
+ and returns the previous cancelability type
+ at the location referenced by \fIoldtype\fR.
+ Legal values for
+ \fItype\fR
+ are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.
+ .PP
+ The cancelability state and type of any newly
+ created threads, including the thread in which
+ \fImain()\fR
+ was first invoked,
+ are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED
+ respectively.
+ .PP
+ The
+ \fIpthread_testcancel()\fR
+ function creates a cancellation point in the calling thread.
+ The
+ \fIpthread_testcancel()\fR
+ function has no effect if cancelability is disabled.
+ .SH "RETURN VALUE"
+ If successful, the
+ \fIpthread_setcancelstate()\fR
+ and
+ \fIpthread_setcanceltype()\fR
+ functions return zero.
+ Otherwise, an error number is returned to indicate the error.
+ .SH "ERRORS"
+ The
+ \fIpthread_setcancelstate()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The specified state is not
+ \s-1PTHREAD_CANCEL_ENABLE\s0 or \s-1PTHREAD_CANCEL_DISABLE\s0.
+ .PP
+ The
+ \fIpthread_setcanceltype()\fR
+ function may fail if:
+ .Ip "[\s-1EINVAL\s0]" 4
+ The specified type is not \s-1PTHREAD_CANCEL_DEFERRED\s0
+ or \s-1PTHREAD_CANCEL_ASYNCHRONOUS\s0.
+ .PP
+ These functions will not return an error code of [\s-1EINTR\s0].
+ .SH "EXAMPLES"
+ None.
+ .SH "APPLICATION USAGE"
+ None.
+ .SH "FUTURE DIRECTIONS"
+ None.
+ .SH "SEE ALSO"
+ \fIpthread_cancel()\fR,
+ \fI<pthread.h\fR>.
+
+ .rn }` ''
+ .IX Title "pthread 3"
+ .IX Name "B<pthread> - POSIX.1c Threading API of GNU Pth"
+
+ .IX Header "NAME"
+
+ .IX Header "VERSION"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Subsection "Overview"
+
+ .IX Subsection "Supported Features"
+
+ .IX Subsection "Notes"
+
+ .IX Item "\fBNon-Preemptive Scheduling\fR"
+
+ .IX Item "\fBConflicts with Vendor Implementation\fR"
+
+ .IX Subsection "Further Reading"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "AUTHOR"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Item "1."
+
+ .IX Item "2."
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Item "\s-1PTHREAD_INHERIT_SCHED\s0"
+
+ .IX Item "\s-1PTHREAD_EXPLICIT_SCHED\s0"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Item "1."
+
+ .IX Item "2."
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Item "\s-1PTHREAD_INHERIT_SCHED\s0"
+
+ .IX Item "\s-1PTHREAD_EXPLICIT_SCHED\s0"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ETIMEDOUT\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ETIMEDOUT\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Item "o"
+
+ .IX Item "o"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Item "\s-1PTHREAD_MUTEX_NORMAL\s0"
+
+ .IX Item "\s-1PTHREAD_MUTEX_ERRORCHECK\s0"
+
+ .IX Item "\s-1PTHREAD_MUTEX_RECURSIVE\s0"
+
+ .IX Item "\s-1PTHREAD_MUTEX_DEFAULT\s0"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Item "\s-1PTHREAD_MUTEX_NORMAL\s0"
+
+ .IX Item "\s-1PTHREAD_MUTEX_ERRORCHECK\s0"
+
+ .IX Item "\s-1PTHREAD_MUTEX_RECURSIVE\s0"
+
+ .IX Item "\s-1PTHREAD_MUTEX_DEFAULT\s0"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Item "[\s-1EAGAIN\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EBUSY\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EDEADLK\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOSYS\s0]"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1ENOTSUP\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1EPERM\s0]"
+
+ .IX Item "[\s-1ESRCH\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1ENOMEM\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "_\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|__\|_"
+
+ .IX Header "NAME"
+
+ .IX Header "SYNOPSIS"
+
+ .IX Header "DESCRIPTION"
+
+ .IX Header "RETURN VALUE"
+
+ .IX Header "ERRORS"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Item "[\s-1EINVAL\s0]"
+
+ .IX Header "EXAMPLES"
+
+ .IX Header "APPLICATION USAGE"
+
+ .IX Header "FUTURE DIRECTIONS"
+
+ .IX Header "SEE ALSO"
+
|