OSSP CVS Repository

ossp - Check-in [71]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 71
Date: 2000-Jun-30 14:40:50 (local)
2000-Jun-30 12:40:50 (UTC)
User:rse
Branch:
Comment: *** empty log message ***
Tickets:
Inspections:
Files:
ossp-pkg/pth/ChangeLog      1.516 -> 1.517     4 inserted, 4 deleted
ossp-pkg/pth/Makefile.in      added-> 1.140
ossp-pkg/pth/README      added-> 1.185
ossp-pkg/pth/aclocal.m4      added-> 1.86
ossp-pkg/pth/configure      added-> 1.139
ossp-pkg/pth/pth-config.1      added-> 1.124
ossp-pkg/pth/pth.3      added-> 1.218
ossp-pkg/pth/pth_p.h.in      added-> 1.26
ossp-pkg/pth/pth_vers.c      added-> 1.132
ossp-pkg/pth/pthread-config.1      added-> 1.90
ossp-pkg/pth/pthread.3      added-> 1.94

ossp-pkg/pth/ChangeLog 1.516 -> 1.517

--- ChangeLog    2000/07/01 08:09:23     1.516
+++ ChangeLog    2000/07/01 12:40:50     1.517
@@ -19,14 +19,14 @@
     | ||__   _|
   __|_(_) |_|_____________________________________________________________ 
     
-  Changes between 1.4a1 and 1.4a2 (16-Apr-2000 to xx-Jun-2000)
+  Changes between 1.4a1 and 1.4a2 (16-Apr-2000 to 01-Jul-2000)
+
+   *) Upgraded to GNU Shtool 1.5.0
+      [Ralf S. Engelschall]
 
    *) Added OS/390 support to config.sub.
       [Greg Ames <gregames@raleigh.ibm.com>]
 
-   *) Upgraded to GNU Shtool 1.4.10
-      [Ralf S. Engelschall]
-
    *) Upgraded rse-pmt.ps paper to latest version as it will be
       published on USENIX 2000.
       [Ralf S. Engelschall]


ossp-pkg/pth/Makefile.in -> 1.140

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,533 ----
+ ##
+ ##  GNU Pth - The GNU Portable Threads
+ ##  Copyright (c) 1999-2000 Ralf S. Engelschall <rse@engelschall.com>
+ ##
+ ##  This file is part of GNU Pth, a non-preemptive thread scheduling
+ ##  library which can be found at http://www.gnu.org/software/pth/.
+ ##
+ ##  This library is free software; you can redistribute it and/or
+ ##  modify it under the terms of the GNU Lesser General Public
+ ##  License as published by the Free Software Foundation; either
+ ##  version 2.1 of the License, or (at your option) any later version.
+ ##
+ ##  This library is distributed in the hope that it will be useful,
+ ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ##  Lesser General Public License for more details.
+ ##
+ ##  You should have received a copy of the GNU Lesser General Public
+ ##  License along with this library; if not, write to the Free Software
+ ##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ##  USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
+ ##
+ ##  Makefile.in: Pth Makefile input
+ ##
+                              # ``UNIX -- where you can do anything
+                              #   in two keystrokes, or less...''
+ @SET_MAKE@
+ 
+ ##
+ ##  ____ PATH DEFINITIONS ___________________________________________
+ ##
+ 
+ VPATH       = @srcdir@
+ srcdir      = @srcdir@
+ top_srcdir  = @top_srcdir@
+ 
+ S           = @srcdir_prefix@
+ C           = ./
+ 
+ prefix      = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir      = @bindir@
+ libdir      = @libdir@
+ includedir  = @includedir@
+ mandir      = @mandir@
+ datadir     = @datadir@
+ 
+ ##
+ ##  ____ TOOL DEFINITIONS ___________________________________________
+ ##
+ 
+ SHELL       = /bin/sh
+ CC          = @CC@
+ CPPFLAGS    = @CPPFLAGS@ -I.
+ CFLAGS      = @CFLAGS@
+ LDFLAGS     = @LDFLAGS@
+ LIBS        = @LIBS@
+ SHTOOL      = $(srcdir)/shtool
+ LIBTOOL     = $(C)libtool
+ RM          = rm -f
+ RMDIR       = rmdir
+ TRUE        = true
+ CAT         = cat
+ CP          = cp
+ SED         = sed
+ ECHO        = echo
+ GZIP        = gzip
+ GTAR        = gtar
+ TARDY       = tardy
+ POD2MAN     = pod2man
+ GDB         = gdb
+ PERL        = perl
+ 
+ ##
+ ##  ____ TARGET DEFINITIONS _________________________________________
+ ##
+ 
+ BATCH            = @BATCH@
+ PLATFORM         = @PLATFORM@
+ PTH_MCTX_ID      = @PTH_MCTX_ID@
+ PTH_STACK_GROWTH = @PTH_STACK_GROWTH@
+ 
+ TARGET_ALL  = @TARGET_ALL@
+ TARGET_PREQ = pth_p.h
+ TARGET_LIBS = libpth.la @LIBPTHREAD_LA@
+ TARGET_MANS = $(S)pth-config.1 $(S)pth.3 @PTHREAD_CONFIG_1@ @PTHREAD_3@
+ TARGET_TEST = test_std test_mp test_misc test_philo test_sig \
+               test_select test_httpd test_sfio @TEST_PTHREAD@
+ 
+ #   object files for library generation
+ #   (order is just aesthically important)
+ LOBJS = pth_debug.lo pth_ring.lo pth_pqueue.lo pth_time.lo pth_errno.lo \
+         pth_mctx.lo pth_tcb.lo pth_sched.lo pth_attr.lo pth_lib.lo pth_event.lo \
+         pth_data.lo pth_clean.lo pth_cancel.lo pth_msg.lo pth_sync.lo pth_fork.lo \
+         pth_util.lo pth_high.lo pth_syscall.lo pth_ext.lo pth_compat.lo pth_string.lo
+ 
+ #   source files for header generation
+ #   (order is important and has to follow dependencies in pth_p.h)
+ HSRCS = $(S)pth_compat.c $(S)pth_debug.c $(S)pth_syscall.c $(S)pth_errno.c $(S)pth_ring.c $(S)pth_mctx.c \
+         $(S)pth_clean.c $(S)pth_time.c $(S)pth_tcb.c $(S)pth_util.c $(S)pth_pqueue.c $(S)pth_event.c \
+         $(S)pth_sched.c $(S)pth_data.c $(S)pth_msg.c $(S)pth_cancel.c $(S)pth_sync.c $(S)pth_attr.c $(S)pth_lib.c \
+         $(S)pth_fork.c $(S)pth_high.c $(S)pth_ext.c $(S)pth_string.c
+ 
+ ##
+ ##  ____ UTILITY DEFINITIONS _________________________________________
+ ##
+ 
+ _VERSION_FILE = \
+        $(S)pth_vers.c
+ 
+ _VERSION = \
+        echo "updating package version"; \
+        $(SHTOOL) version -lc -n 'GNU Pth' -p pth_internal_ $$OPT $(_VERSION_FILE); \
+        V=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`; \
+        $(SED) -e "s/Version .*(.*)/Version $$V/g" <README >README.n && mv README.n README; \
+        V=`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`; \
+        $(SED) -e "s/%define ver .*/%define ver $$V/g" <pth.spec >pth.spec.n && mv pth.spec.n pth.spec
+ 
+ _TARBALL = \
+        $(SHTOOL) tarball -o $${NAME}.tar.gz -d $${NAME} -u gnu -g pth \
+                          -e 'CVS,\.cvsignore,\.configure,\.\#.*,\.[ao]$$' -c 'gzip --best' .
+ 
+ _MANPAGE = \
+        echo "Formatting $${BASENAME}.pod into $${BASENAME}.$${SEC} via $(POD2MAN)"; \
+        V1=`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`; \
+        V2=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`; \
+        D=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE) |\
+           $(SED) -e 's;.*(;;' -e 's;).*;;'`; \
+        $(POD2MAN) --section=$${SEC} --center="$${ONELINE}" \
+                   --release="$$D" --date="$${NAME} $$V1" $(S)$${BASENAME}.pod |\
+        $(SED) -e "s;PTH_VERSION_STR;$$V2;" >$${BASENAME}.$${SEC}
+ 
+ _DEBUG = \
+        core=""; \
+        if [ -f $$TEST.core ]; then \
+            core="$$TEST.core"; \
+     elif [ -f core ]; then \
+                core="core"; \
+     fi; \
+        $(LIBTOOL) --mode=execute $(GDB) $$TEST $$core
+ 
+ ##
+ ##  ____ END USER TARGETS ____________________________________________
+ ##
+ 
+ #   be aware of libtool when building the objects
+ .SUFFIXES:
+ .SUFFIXES: .c .o .lo
+ .c.o:
+        $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
+ .c.lo:
+        $(LIBTOOL) --mode=compile --quiet $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
+ 
+ #   the default target
+ all: all-normal
+ all-normal: $(TARGET_ALL)
+        @touch .done-all
+        @$(MAKE) $(MFLAGS) what-next
+ all-for-install: $(TARGET_ALL)
+        @touch .done-all
+ 
+ #   build the private shared header file
+ pth_p.h: $(S)pth_p.h.in
+        $(SHTOOL) scpp -o pth_p.h -t $(S)pth_p.h.in -Dcpp -Cintern -M '==#==' $(HSRCS)
+ 
+ #   build the static and possibly shared libraries
+ libpth.la: $(LOBJS)
+        $(LIBTOOL) --mode=link --quiet $(CC) -o libpth.la $(LOBJS) \
+        -rpath $(libdir) -version-info `$(SHTOOL) version -lc -dlibtool $(_VERSION_FILE)`
+ libpthread.la: pthread.lo $(LOBJS)
+        $(LIBTOOL) --mode=link --quiet $(CC) -o libpthread.la pthread.lo $(LOBJS) \
+        -rpath $(libdir) -version-info `$(SHTOOL) version -lc -dlibtool $(_VERSION_FILE)`
+ 
+ #   build the manual pages
+ $(S)pth-config.1: $(S)pth-config.pod $(_VERSION_FILE)
+        @BASENAME="pth-config"; SEC=1; \
+        NAME="GNU Pth"; ONELINE="GNU Portable Threads"; \
+        $(_MANPAGE)
+ $(S)pth.3: $(S)pth.pod $(_VERSION_FILE)
+        @BASENAME="pth"; SEC=3; \
+        NAME="GNU Pth"; ONELINE="GNU Portable Threads"; \
+        $(_MANPAGE)
+ $(S)pthread-config.1: $(S)pthread-config.pod $(_VERSION_FILE)
+        @BASENAME="pthread-config"; SEC=1; \
+        NAME="GNU Pth"; ONELINE="POSIX Threading API of GNU Pth"; \
+        $(_MANPAGE)
+ $(S)pthread.3: $(S)pthread.pod $(_VERSION_FILE)
+        @BASENAME="pthread"; SEC=3; \
+        NAME="GNU Pth"; ONELINE="POSIX Threading API of GNU Pth"; \
+        $(_MANPAGE)
+ 
+ #   build test program
+ test_std: test_std.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_std test_std.o test_common.o libpth.la $(LIBS)
+ test_httpd: test_httpd.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_httpd test_httpd.o test_common.o libpth.la $(LIBS)
+ test_misc: test_misc.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_misc test_misc.o test_common.o libpth.la $(LIBS)
+ test_mp: test_mp.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_mp test_mp.o test_common.o libpth.la $(LIBS)
+ test_philo: test_philo.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_philo test_philo.o test_common.o libpth.la $(LIBS)
+ test_sig: test_sig.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_sig test_sig.o test_common.o libpth.la $(LIBS)
+ test_select: test_select.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_select test_select.o test_common.o libpth.la $(LIBS)
+ test_sfio: test_sfio.o test_common.o libpth.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_sfio test_sfio.o test_common.o libpth.la $(LIBS)
+ test_pthread: test_pthread.o test_common.o libpthread.la
+        $(LIBTOOL) --mode=link --quiet $(CC) $(LDFLAGS) -o test_pthread test_pthread.o test_common.o libpthread.la $(LIBS)
+ 
+ #   install the package
+ install: all-for-install
+        @$(MAKE) $(MFLAGS) install-dirs install-pth @INSTALL_PTHREAD@
+        @touch .done-install
+        @$(MAKE) $(MFLAGS) what-next
+ install-dirs:
+        $(SHTOOL) mkdir -f -p -m 755 $(prefix)
+        $(SHTOOL) mkdir -f -p -m 755 $(bindir)
+        $(SHTOOL) mkdir -f -p -m 755 $(includedir)
+        $(SHTOOL) mkdir -f -p -m 755 $(libdir)
+        $(SHTOOL) mkdir -f -p -m 755 $(mandir)/man1
+        $(SHTOOL) mkdir -f -p -m 755 $(mandir)/man3
+        $(SHTOOL) mkdir -f -p -m 755 $(datadir)/aclocal
+ install-pth:
+        $(SHTOOL) install -c -m 755 pth-config $(bindir)/pth-config
+        $(SHTOOL) install -c -m 644 $(S)pth-config.1 $(mandir)/man1/pth-config.1
+        $(SHTOOL) install -c -m 644 $(S)pth.3 $(mandir)/man3/pth.3
+        $(SHTOOL) install -c -m 644 $(S)pth.m4 $(datadir)/aclocal/pth.m4
+        $(SHTOOL) install -c -m 644 pth.h $(includedir)/pth.h
+        @umask 022; $(LIBTOOL) --mode=install \
+        $(SHTOOL) install -c libpth.la $(libdir)/libpth.la
+ install-pthread:
+        $(SHTOOL) install -c -m 755 pthread-config $(bindir)/pthread-config
+        $(SHTOOL) install -c -m 644 $(S)pthread-config.1 $(mandir)/man1/pthread-config.1
+        $(SHTOOL) install -c -m 644 pthread.h $(includedir)/pthread.h
+        $(SHTOOL) install -c -m 644 $(S)pthread.3 $(mandir)/man3/pthread.3
+        @umask 022; $(LIBTOOL) --mode=install \
+        $(SHTOOL) install -c libpthread.la $(libdir)/libpthread.la
+ 
+ #   uninstall the package
+ uninstall:
+        @$(MAKE) $(MFLAGS) @UNINSTALL_PTHREAD@ uninstall-pth uninstall-dirs
+        @touch .done-uninstall
+        @$(MAKE) $(MFLAGS) what-next
+ uninstall-pthread:
+        $(RM) $(bindir)/pthread-config
+        $(RM) $(mandir)/man1/pthread-config.1
+        $(RM) $(includedir)/pthread.h
+        $(RM) $(mandir)/man3/pthread.3
+        @$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/libpthread.la
+ uninstall-pth:
+        $(RM) $(bindir)/pth-config
+        $(RM) $(mandir)/man1/pth-config.1
+        $(RM) $(mandir)/man3/pth.3
+        $(RM) $(datadir)/aclocal/pth.m4
+        $(RM) $(includedir)/pth.h
+        @$(LIBTOOL) --mode=uninstall $(RM) $(libdir)/libpth.la
+ uninstall-dirs:
+        -$(RMDIR) $(datadir)/aclocal >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(datadir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(mandir)/man1 >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(mandir)/man3 >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(mandir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(libdir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(includedir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(bindir) >/dev/null 2>&1 || $(TRUE)
+        -$(RMDIR) $(prefix) >/dev/null 2>&1 || $(TRUE)
+ 
+ #   clean the source tree for re-building
+ clean:
+        $(RM) $(TARGET_PREQ)
+        $(RM) $(TARGET_TEST)
+        $(RM) $(TARGET_LIBS)
+        $(RM) core *.core *.bak *~
+        $(RM) *.o *.lo
+        $(RM) .libs/*
+        -$(RMDIR) .libs >/dev/null 2>&1 || $(TRUE)
+        $(RM) .done-*
+ 
+ #   clean the source tree for re-configuring and re-building
+ distclean: clean
+        $(RM) Makefile
+        $(RM) pth-config pth_acdef.h pth_acmac.h pth.h
+        $(RM) pthread-config pthread.h
+        $(RM) config.log config.cache config.status
+        $(RM) -r striptease.dir
+        $(RM) libtool
+ 
+ #   clean the source tree by removing really all generate stuff
+ realclean: distclean
+        $(RM) $(TARGET_MANS)
+ 
+ #   give hints what to do as the next step
+ what-next:
+        -@if [ ".$(BATCH)" != .yes ]; then \
+            if [ ".$(WHEN)" != . ]; then \
+                when="$(WHEN)"; \
+            else \
+                when="Now"; \
+            fi; \
+            echo ""; \
+            if [ ! -f .done-all ]; then \
+                cmd=`$(SHTOOL) echo -e "%Bmake%b"`; \
+                echo "$$when please type \`$$cmd' to compile. Good luck."; \
+            elif [ ! -f .done-test ]; then \
+                cmd=`$(SHTOOL) echo -e "%Bmake test%b"`; \
+                echo "$$when please type \`$$cmd' to run a quick test suite. Hope it works."; \
+            elif [ ! -f .done-install ]; then \
+                cmd=`$(SHTOOL) echo -e "%Bmake install%b"`; \
+                echo "$$when please type \`$$cmd' to install the package."; \
+            elif [ ! -f .done-uninstall ]; then \
+                cmd=`$(SHTOOL) echo -e "%Bmake uninstall%b"`; \
+                echo "$$when use the package (you can remove it later via \`$$cmd')."; \
+                cmd=`$(SHTOOL) echo -e "%Becho \"subscribe pth-users\" | mail pth-users-request@gnu.org%b"`; \
+                echo "Additionally you should consider subscribing to the GNU Pth support"; \
+                echo "mailing list pth-users@gnu.org by running the following command:"; \
+                echo "\`$$cmd'"; \
+            else \
+                echo "$$when there is nothing more you can do here... ;)"; \
+                echo "There is just \`make clean' left for you."; \
+            fi; \
+            echo ""; \
+        fi
+ 
+ #   execute and debug one of the test programs
+ test: test-std
+ test-std: test_std
+        -@./test_std; \
+        if [ $$? -eq 0 ]; then \
+            touch .done-test; \
+            if [ ".`grep $(PLATFORM) $(S)PORTING`" = . ]; then \
+                VERSION=`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`; \
+                echo "Please send the following summary line via Email to the author"; \
+                echo "Ralf S. Engelschall <rse@engelschall.com> for inclusion into"; \
+                echo "the list of successfully tested platforms (see PORTING file):"; \
+                echo ""; \
+                $(SHTOOL) echo -e "Pth: %BOK%b: %B$(PLATFORM)%b | %B$(PTH_MCTX_ID)%b | %B$(PTH_STACK_GROWTH)%b | %B$$VERSION%b"; \
+                $(MAKE) $(MFLAGS) what-next WHEN="Then"; \
+            else \
+                $(MAKE) $(MFLAGS) what-next WHEN="Now"; \
+            fi; \
+            exit 0; \
+        else \
+            VERSION=`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`; \
+            echo "Please send the following summary line together with details about"; \
+            $(SHTOOL) echo -e "the configuration (%Bpth_acdef.h%b, %Bpth_acmac.h%b, %Bconfig.status%b, %Bconfig.log%b)"; \
+            echo "and build/test steps (output of 'make' and 'make test') to the author"; \
+            echo "Ralf S. Engelschall <rse@engelschall.com> to help him in tracking"; \
+            echo "down your platform problem."; \
+            echo ""; \
+            $(SHTOOL) echo -e "Pth: %BFAILED%b: %B$(PLATFORM)%b | %B$(PTH_MCTX_ID)%b | %B$(PTH_STACK_GROWTH)%b | %B$$VERSION%b"; \
+            echo ""; \
+            exit 1; \
+        fi
+ test-httpd: test_httpd
+        ./test_httpd
+ test-mp: test_mp
+        ./test_mp
+ test-misc: test_misc
+        ./test_misc
+ test-philo: test_philo
+        ./test_philo
+ test-sig: test_sig
+        ./test_sig
+ test-select: test_select
+        ./test_select
+ test-sfio: test_sfio
+        ./test_sfio
+ test-pthread: test_pthread
+        ./test_pthread
+ 
+ #   GNU compat targets
+ check: test
+ installcheck:
+ installdirs: install-dirs
+ install-strip: install
+ mostlyclean: clean
+ maintainer-clean: realclean
+ info:
+ dvi:
+ TAGS:
+ 
+ ##
+ ##  ____ DEVELOPER TARGETS ___________________________________________
+ ##  (THIS IS NOT INTENDED TO BE RUN BY END USERS)
+ ##
+ 
+ #   fixup the permissions in the source tree
+ fixperm:
+        @echo "Fixing permissions in source tree"
+        @$(SHTOOL) fixperm *
+ 
+ #   update Autoconf files
+ update-autoconf: configure pth_acdef.h.in
+ configure: configure.in
+        $(RM) configure
+        autoconf
+ pth_acdef.h.in: configure.in acconfig.h acheader.m4
+        $(RM) pth_acdef.h.in
+        cat acheader.m4 configure.in | autoheader - >pth_acdef.h.in
+ 
+ #   update build tools
+ update-tools:
+        @$(RM) shtool ltmain.sh ltconfig
+        @$(MAKE) $(MFLAGS) shtool ltmain.sh ltconfig
+ shtool:
+        shtoolize -o shtool echo version scpp mkdir install fixperm tarball
+ ltmain.sh:
+        @F=`libtoolize -n -c -f | grep 'cp.*ltmain.sh' |\
+            $(SED) -e 's;[^/]*;;' -e 's; .*;;'`; \
+        $(ECHO) "ltmain.sh <-- $$F"; cat $$F |\
+        $(SED) -e 's:/bin/sh; then:/bin/sh || test ".`$(ECHO) $$nonopt | grep shtool`" != .;then:' \
+            -e 's:exec \$$SHELL \$$0 --finish:exit 0 #:' >ltmain.sh
+ ltconfig:
+        @F=`libtoolize -n -c -f | grep 'cp.*ltconfig' | $(SED) -e 's;[^/]*;;' -e 's; .*;;'`; \
+        $(ECHO) "ltconfig <-- $$F"; $(CAT) $$F >ltconfig
+ 
+ #   debug the test programs
+ debug: debug-std
+ debug-std: test_std
+        TEST=test_std && $(_DEBUG)
+ debug-httpd: test_httpd
+        TEST=test_httpd && $(_DEBUG)
+ debug-mp: test_mp
+        TEST=test_mp && $(_DEBUG)
+ debug-misc: test_misc
+        TEST=test_misc && $(_DEBUG)
+ debug-philo: test_philo
+        TEST=test_philo && $(_DEBUG)
+ debug-sig: test_sig
+        TEST=test_sig && $(_DEBUG)
+ debug-select: test_select
+        TEST=test_select && $(_DEBUG)
+ debug-sfio: test_sfio
+        TEST=test_sfio && $(_DEBUG)
+ debug-pthread: test_pthread
+        TEST=test_pthread && $(_DEBUG)
+ 
+ #   roll the release or snapshot tarball
+ dist: distclean fixperm
+        @V=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; NAME="pth-$$V"; \
+        $(ECHO) "Rolling RELEASE tarball $$NAME.tar.gz"; $(_TARBALL)
+ snap: distclean fixperm
+        @V=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; NAME="pth-$$V-SNAP"; \
+        $(ECHO) "Rolling SNAPSHOT tarball $$NAME.tar.gz"; $(_TARBALL)
+ 
+ #   increase or update version information
+ new-version:
+        @V="$(VERSION)"; \
+        if [ ".$$V" != . ]; then \
+                OPT="-s$$V"; \
+        else \
+                OPT="-e"; \
+        fi; \
+        $(_VERSION)
+ update-version:
+        @OPT="-s`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`" && $(_VERSION)
+ 
+ #   make a striptease
+ striptease:
+        @$(PERL) striptease.pl
+ 
+ #   create dependencies
+ depend:
+        $(CP) Makefile.in Makefile.in.bak \
+        && $(SED) -ne '1,/^# DO NOT REMOVE/p' Makefile.in > Makefile.new \
+        && $(CC) -MM $(CPPFLAGS) $(CFLAGS) *.c |\
+           $(SED) -e 's/^\(pth_.*\)\.o:/\1.lo:/' >> Makefile.new \
+        && $(CP) Makefile.new Makefile.in \
+        && $(RM) Makefile.new
+ 
+ ##
+ ##  ____ DEPENDENCY AREA ____________________________________________
+ ##  (AUTOMATICALLY UPDATED - DO NOT EDIT)
+ ##
+ 
+ $(LOBJS): Makefile
+ 
+ # DO NOT REMOVE
+ pth_attr.lo: pth_attr.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_cancel.lo: pth_cancel.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_clean.lo: pth_clean.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_compat.lo: pth_compat.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_data.lo: pth_data.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_debug.lo: pth_debug.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_errno.lo: pth_errno.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_event.lo: pth_event.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_ext.lo: pth_ext.c pth_p.h pth_vers.c pth.h pth_acdef.h pth_acmac.h
+ pth_fork.lo: pth_fork.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_high.lo: pth_high.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_lib.lo: pth_lib.c pth_p.h pth_vers.c pth.h pth_acdef.h pth_acmac.h
+ pth_mctx.lo: pth_mctx.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_msg.lo: pth_msg.c pth_p.h pth_vers.c pth.h pth_acdef.h pth_acmac.h
+ pth_pqueue.lo: pth_pqueue.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_ring.lo: pth_ring.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_sched.lo: pth_sched.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_sync.lo: pth_sync.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_syscall.lo: pth_syscall.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_tcb.lo: pth_tcb.c pth_p.h pth_vers.c pth.h pth_acdef.h pth_acmac.h
+ pth_time.lo: pth_time.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_util.lo: pth_util.c pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ pth_vers.lo: pth_vers.c
+ pthread.o: pthread.c pthread.h pth_p.h pth_vers.c pth.h pth_acdef.h \
+  pth_acmac.h
+ test_common.o: test_common.c pth.h test_common.h
+ test_httpd.o: test_httpd.c pth.h test_common.h
+ test_misc.o: test_misc.c pth.h
+ test_mp.o: test_mp.c pth.h test_common.h
+ test_philo.o: test_philo.c pth.h test_common.h
+ test_pthread.o: test_pthread.c pthread.h
+ test_select.o: test_select.c pth.h
+ test_sfio.o: test_sfio.c pth.h
+ test_sig.o: test_sig.c pth.h
+ test_std.o: test_std.c pth.h


ossp-pkg/pth/README -> 1.185

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,83 ----
+    ____  _   _
+   |  _ \| |_| |__
+   | |_) | __| '_ \                    ``Only those who attempt
+   |  __/| |_| | | |                     the absurd can achieve
+   |_|    \__|_| |_|                     the impossible.''
+ 
+   GNU Pth - The GNU Portable Threads
+   Version 1.4a2 (01-Jul-2000)
+ 
+   ABSTRACT
+ 
+   Pth is a very portable POSIX/ANSI-C based library for Unix platforms
+   which provides non-preemptive priority-based scheduling for multiple
+   threads of execution (aka `multithreading') inside event-driven
+   applications. All threads run in the same address space of the server
+   application, but each thread has its own individual program-counter,
+   run-time stack, signal mask and errno variable.
+ 
+   The thread scheduling itself is done in a cooperative way, i.e., the
+   threads are managed by a priority- and event-based non-preemptive
+   scheduler. The intention is, that this way one can achieve better
+   portability and run-time performance than with preemptive scheduling.
+   The event facility allows threads to wait until various types of
+   events occur, including pending I/O on filedescriptors, asynchronous
+   signals, elapsed timers, pending I/O on message ports, thread and
+   process termination, and even customized callback functions.
+ 
+   Additionally Pth provides an optional emulation API for POSIX.1c
+   threads (`Pthreads') which can be used for backward compatibility to
+   existing multithreaded applications.
+ 
+   Finally, Pth guarranties its fixed set of API functionality on
+   all platforms, i.e., functions like pth_poll(3), pth_readv(3) or
+   pth_writev(3) are always available, even if the particular underlaying
+   platform does not actually support their functionality (through the
+   system calls poll(2), readv(2), writev(2), etc).
+ 
+   Although Pth is very feature-rich, it is a rather small threading
+   library. It consists only of approximately 7,000 line (or 300 KB) of
+   ANSI C code which are auto-configured with approximately 400 lines (or
+   60 KB) of Autoconf/m4 macros and which are documented by approximately
+   3,000 lines (or 150 KB) of documentation. Additionally the sources
+   are documented with approximately 3,600 additional lines of comments.
+   As a result, the whole source tree is just about 1.5 MB in size and
+   fits into a small tarball less than 350 KB in size. This allows Pth to
+   fit very well even into the source tree of other applications without
+   bloating it up very much.
+ 
+   Pth was successfully tested on FreeBSD, NetBSD, OpenBSD, BSDI,
+   GNU/Linux, Solaris, HPUX, Tru64 (OSF/1), AIX, IRIX, UnixWare, SCO
+   OpenServer, SINIX, ReliantUNIX, ISC, AmigaOS, Rhapsody (MacOS X), FTX,
+   AUX and Win32/Cygwin. And it should should automatically adjust itself
+   to remaining Unix platforms, too.
+ 
+   COPYRIGHT AND LICENSE
+ 
+   Copyright (c) 1999-2000 Ralf S. Engelschall <rse@engelschall.com>
+ 
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+ 
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   Lesser General Public License for more details.
+ 
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library (see file COPYING); if not, write
+   to the Free Software Foundation, Inc., 59 Temple Place, Suite
+   330, Boston, MA 02111-1307 USA, or contact Ralf S. Engelschall
+   <rse@engelschall.com>.
+ 
+   HOME AND DOCUMENTATION
+ 
+   The documentation and latest release can be found on
+ 
+   http://www.gnu.org/software/pth/
+   ftp://ftp.gnu.org/gnu/pth/
+                                        Ralf S. Engelschall
+                                        rse@engelschall.com
+                                        www.engelschall.com


ossp-pkg/pth/aclocal.m4 -> 1.86

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,1639 ----
+ dnl ##
+ dnl ##  GNU Pth - The GNU Portable Threads
+ dnl ##  Copyright (c) 1999-2000 Ralf S. Engelschall <rse@engelschall.com>
+ dnl ##
+ dnl ##  This file is part of GNU Pth, a non-preemptive thread scheduling
+ dnl ##  library which can be found at http://www.gnu.org/software/pth/.
+ dnl ##
+ dnl ##  This library is free software; you can redistribute it and/or
+ dnl ##  modify it under the terms of the GNU Lesser General Public
+ dnl ##  License as published by the Free Software Foundation; either
+ dnl ##  version 2.1 of the License, or (at your option) any later version.
+ dnl ##
+ dnl ##  This library is distributed in the hope that it will be useful,
+ dnl ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ dnl ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ dnl ##  Lesser General Public License for more details.
+ dnl ##
+ dnl ##  You should have received a copy of the GNU Lesser General Public
+ dnl ##  License along with this library; if not, write to the Free Software
+ dnl ##  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ dnl ##  USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
+ dnl ##
+ dnl ##  aclocal.m4: Pth Autoconf macros
+ dnl ##
+ divert(-1)
+                         dnl # ``"Reuse an expert's code" is the right
+                         dnl #   advice for most people. But it's a useless 
+                         dnl #   advice for the experts writing the code 
+                         dnl #   in the first place.'
+                         dnl #               -- Dan J. Bernstein
+ 
+ dnl ##
+ dnl ##  Display Configuration Headers
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_MSG_PART(<text>)
+ dnl ##
+ 
+ define(AC_MSG_PART,[dnl
+ if test ".$enable_subdir" != .yes; then
+     AC_MSG_RESULT()
+     AC_MSG_RESULT(${TB}$1:${TN})
+ fi
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Display a message under --verbose
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_MSG_VERBOSE(<text>)
+ dnl ##
+ 
+ define(AC_MSG_VERBOSE,[dnl
+ if test ".$verbose" = .yes; then
+     AC_MSG_RESULT([  $1])
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Do not display message for a command
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_MSG_SILENT(...)
+ dnl ##
+ 
+ define(AC_FD_TMP, 9)
+ define(AC_MSG_SILENT,[dnl
+ exec AC_FD_TMP>&AC_FD_MSG AC_FD_MSG>/dev/null
+ $1
+ exec AC_FD_MSG>&AC_FD_TMP AC_FD_TMP>&-
+ ])
+ 
+ dnl ##
+ dnl ##  Perform something only once
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_ONCE(<action>)
+ dnl ##
+ 
+ define(AC_ONCE,[
+ ifelse(ac_once_$1, already_done, ,[
+     define(ac_once_$1, already_done)
+     $2
+ ])dnl
+ ])
+ 
+ dnl ##
+ dnl ##  Support for $(S)
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_SRCDIR_PREFIX(<varname>)
+ dnl ##
+ 
+ AC_DEFUN(AC_SRCDIR_PREFIX,[
+ ac_prog=[$]0
+ changequote(, )dnl
+ ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`
+ changequote([, ])dnl
+ if test ".$ac_srcdir" = ".$ac_prog"; then
+     ac_srcdir=""
+ elif test "x$ac_srcdir" = "x."; then
+     ac_srcdir=""
+ else
+     if test ".$CFLAGS" = .; then
+         CFLAGS="-I$ac_srcdir"
+     else
+         CFLAGS="$CFLAGS -I$ac_srcdir"
+     fi
+     ac_srcdir="$ac_srcdir/"
+ fi
+ $1="$ac_srcdir"
+ AC_SUBST($1)
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Support for --enable-subdir (for use with pth.m4)
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_ENABLESUBDIR
+ dnl ##
+ 
+ AC_DEFUN(AC_ENABLESUBDIR,[
+ AC_ARG_ENABLE(subdir,dnl
+ [  --enable-subdir         enable local building as subdirectory (default=no)],[dnl
+ ],[dnl
+ enable_subdir=no
+ ])dnl
+ if test ".$enable_subdir" = .yes; then
+     enable_batch=yes
+     enable_shared=no
+ fi
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Support for Configuration Headers
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_HEADLINE(<short-name>, <long-name>,
+ dnl ##                <vers-var>, <vers-file>,
+ dnl ##                <copyright>)
+ dnl ##
+ 
+ AC_DEFUN(AC_HEADLINE,[dnl
+ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+ #   configuration header
+ if test ".`echo dummy [$]@ | grep enable-subdir`" != .; then
+     enable_subdir=yes
+ fi
+ if test ".`echo dummy [$]@ | grep help`" = .; then
+     #   bootstrapping shtool
+     ac_prog=[$]0
+ changequote(, )dnl
+     ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`
+ changequote([, ])dnl
+     test ".$ac_srcdir" = ".$ac_prog" && ac_srcdir=.
+     ac_shtool="${CONFIG_SHELL-/bin/sh} $ac_srcdir/shtool"
+ 
+     #   find out terminal sequences
+     if test ".$enable_subdir" != .yes; then
+         TB=`$ac_shtool echo -n -e %B 2>/dev/null`
+         TN=`$ac_shtool echo -n -e %b 2>/dev/null`
+     else
+         TB=''
+         TN=''
+     fi
+ 
+     #   find out package version
+     $3_STR="`$ac_shtool version -lc -dlong $ac_srcdir/$4`"
+     AC_SUBST($3_STR)
+ 
+     #   friendly header ;)
+     if test ".$enable_subdir" != .yes; then
+         echo "Configuring ${TB}$1${TN} ($2), Version ${TB}${$3_STR}${TN}"
+         echo "$5"
+     fi
+ 
+     #   additionally find out hex version
+     $3_HEX="`$ac_shtool version -lc -dhex $ac_srcdir/$4`"
+     AC_SUBST($3_HEX)
+ fi
+ AC_DIVERT_POP()
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Support for Platform IDs
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_PLATFORM(<variable>)
+ dnl ##
+ 
+ AC_DEFUN(AC_PLATFORM,[
+ if test ".$host" != .NONE; then
+     $1="$host"
+ elif test ".$nonopt" != .NONE; then
+     $1="$nonopt"
+ else
+     $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`
+ fi
+ $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub $$1` || exit 1
+ AC_SUBST($1)
+ if test ".$enable_subdir" != .yes; then
+     echo "Platform: ${TB}${$1}${TN}"
+ fi
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Support for config.param files
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CONFIG_PARAM(<file>)
+ dnl ##
+ 
+ AC_DEFUN(AC_CONFIG_PARAM,[
+ AC_DIVERT_PUSH(-1)
+ AC_ARG_WITH(param,[  --with-param=ID[,ID,..] load parameters from $1])
+ AC_DIVERT_POP()
+ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)
+ ac_prev=""
+ ac_param=""
+ if test -f $1; then
+     ac_param="$1:common"
+ fi
+ for ac_option
+ do
+     if test ".$ac_prev" != .; then
+         eval "$ac_prev=\$ac_option"
+         ac_prev=""
+         continue
+     fi
+     case "$ac_option" in
+         -*=*) ac_optarg=`echo "$ac_option" | sed 's/[[-_a-zA-Z0-9]]*=//'` ;;
+            *) ac_optarg="" ;;
+     esac
+     case "$ac_option" in
+         --with-param=* )
+             case $ac_optarg in
+                 *:* )
+                     ac_from=`echo $ac_optarg | sed -e 's/:.*//'`
+                     ac_what=`echo $ac_optarg | sed -e 's/.*://'`
+                     ;;
+                 * )
+                     ac_from="$1"
+                     ac_what="$ac_optarg"
+                     ;;
+             esac
+             if test ".$ac_param" = .; then
+                 ac_param="$ac_from:$ac_what"
+             else
+                 ac_param="$ac_param,$ac_from:$ac_what"
+             fi
+             ;;
+     esac
+ done
+ if test ".$ac_param" != .; then
+     # echo "loading parameters"
+     OIFS="$IFS"
+     IFS=","
+     pconf="/tmp/autoconf.$$"
+     echo "ac_options=''" >$pconf
+     ac_from="$1"
+     for ac_section in $ac_param; do
+         changequote(, )
+         case $ac_section in
+             *:* )
+                 ac_from=`echo "$ac_section" | sed -e 's/:.*//'`
+                 ac_section=`echo "$ac_section" | sed -e 's/.*://'`
+                 ;;
+         esac
+         (echo ''; cat $ac_from; echo '') |\
+         sed -e "1,/[   ]*[     ]*${ac_section}[        ]*{[    ]*/d" \
+             -e '/[     ]*}[    ]*/,$d' \
+             -e ':join' -e '/\\[        ]*$/N' -e 's/\\[        ]*\n[   ]*//' -e 'tjoin' \
+             -e 's/^[   ]*//g' \
+             -e 's/^\([^-].*=.*\) IF \(.*\)$/if \2; then \1; fi/' \
+             -e 's/^\(--.*=.*\) IF \(.*\)$/if \2; then ac_options="$ac_options \1"; fi/' \
+             -e 's/^\(--.*\) IF \(.*\)$/if \2; then ac_options="$ac_options \1"; fi/' \
+             -e 's/^\(--.*=.*\)$/ac_options="$ac_options \1"/' \
+             -e 's/^\(--.*\)$/ac_options="$ac_options \1"/' \
+             >>$pconf
+         changequote([, ])
+     done
+     IFS="$OIFS"
+     . $pconf
+     rm -f $pconf >/dev/null 2>&1
+     if test ".[$]*" = .; then
+         set -- $ac_options
+     else
+         set -- "[$]@" $ac_options
+     fi
+ fi
+ AC_DIVERT_POP()
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Check whether compiler option works
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_COMPILER_OPTION(<name>, <display>, <option>,
+ dnl ##                       <action-success>, <action-failure>)
+ dnl ##
+ 
+ AC_DEFUN(AC_COMPILER_OPTION,[dnl
+ AC_MSG_CHECKING(for compiler option $2)
+ AC_CACHE_VAL(ac_cv_compiler_option_$1,[
+ cat >conftest.$ac_ext <<EOF
+ int main() { return 0; }
+ EOF
+ ${CC-cc} -c $CFLAGS $CPPFLAGS $3 conftest.$ac_ext 1>conftest.out 2>conftest.err
+ if test $? -ne 0 -o -s conftest.err; then
+      ac_cv_compiler_option_$1=no
+ else
+      ac_cv_compiler_option_$1=yes
+ fi
+ rm -f conftest.$ac_ext conftest.out conftest.err
+ ])dnl
+ if test ".$ac_cv_compiler_option_$1" = .yes; then
+     ifelse([$4], , :, [$4])
+ else
+     ifelse([$5], , :, [$5])
+ fi
+ AC_MSG_RESULT([$ac_cv_compiler_option_$1])
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Check whether `long long' and `long double' type exists
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_LONGLONG
+ dnl ##    AC_CHECK_LONGDOUBLE
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_LONGLONG,[dnl
+ AC_MSG_CHECKING(for built-in type long long)
+  AC_CACHE_VAL(ac_cv_type_longlong,[
+   AC_TRY_LINK([
+ #include <sys/types.h>
+   ],[
+     long long X = 2, Y = 1, Z;
+     Z = X / Y; 
+   ],
+     AC_DEFINE(HAVE_LONGLONG)
+     ac_cv_type_longlong=yes, 
+     ac_cv_type_longlong=no
+   )dnl
+  ])dnl
+ AC_MSG_RESULT([$ac_cv_type_longlong])
+ ])dnl
+ 
+ AC_DEFUN(AC_CHECK_LONGDOUBLE,[dnl
+ AC_MSG_CHECKING(for built-in type long double)
+  AC_CACHE_VAL(ac_cv_type_longdouble,[
+   AC_TRY_LINK([
+ #include <sys/types.h>
+   ],[
+     long double X = 2, Y = 1, Z;
+     Z = X / Y; 
+   ],
+     AC_DEFINE(HAVE_LONGDOUBLE)
+     ac_cv_type_longdouble=yes, 
+     ac_cv_type_longdouble=no
+   )dnl
+  ])dnl
+ AC_MSG_RESULT([$ac_cv_type_longdouble])
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Minimalistic Libtool Glue Code
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_PROG_LIBTOOL(<platform-variable>)
+ dnl ##
+ 
+ AC_DEFUN(AC_PROG_LIBTOOL,[dnl
+ AC_ARG_ENABLE(static,dnl
+ [  --enable-static         build static libraries (default=yes)],
+ enable_static="$enableval",
+ if test ".$enable_static" = .; then
+     enable_static=yes
+ fi
+ )dnl
+ AC_ARG_ENABLE(shared,dnl
+ [  --enable-shared         build shared libraries (default=yes)],
+ enable_shared="$enableval",
+ if test ".$enable_shared" = .; then
+     enable_shared=yes
+ fi
+ )dnl
+ libtool_flags=''
+ dnl libtool_flags="$libtool_flags --cache-file=$cache_file"
+ test ".$silent"            = .yes && libtool_flags="$libtool_flags --silent"
+ test ".$enable_static"     = .no  && libtool_flags="$libtool_flags --disable-static"
+ test ".$enable_shared"     = .no  && libtool_flags="$libtool_flags --disable-shared"
+ test ".$ac_cv_prog_gcc"    = .yes && libtool_flags="$libtool_flags --with-gcc"
+ test ".$ac_cv_prog_gnu_ld" = .yes && libtool_flags="$libtool_flags --with-gnu-ld"
+ CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" \
+ ${CONFIG_SHELL-/bin/sh} $srcdir/ltconfig --no-reexec \
+ $libtool_flags --srcdir=$srcdir --no-verify $srcdir/ltmain.sh $1 ||\
+ AC_MSG_ERROR([libtool configuration failed])
+ dnl (AC_CACHE_LOAD) >/dev/null 2>&1
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Debugging Support
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_DEBUGGING
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_DEBUGGING,[dnl
+ AC_ARG_ENABLE(debug,dnl
+ [  --enable-debug          build for debugging (default=no)],
+ [dnl
+ if test ".$ac_cv_prog_gcc" = ".yes"; then
+     case "$CFLAGS" in
+         *-O* ) ;;
+            * ) CFLAGS="$CFLAGS -O2" ;;
+     esac
+     case "$CFLAGS" in
+         *-g* ) ;;
+            * ) CFLAGS="$CFLAGS -g" ;;
+     esac
+     case "$CFLAGS" in
+         *-pipe* ) ;;
+               * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
+     esac
+     AC_COMPILER_OPTION(ggdb3, -ggdb3, -ggdb3, CFLAGS="$CFLAGS -ggdb3")
+     case $PLATFORM in
+         *-*-freebsd*|*-*-solaris* ) CFLAGS="$CFLAGS -pedantic" ;;
+     esac
+     CFLAGS="$CFLAGS -Wall"
+     WMORE="-Wshadow -Wpointer-arith -Wcast-align -Winline"
+     WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
+     AC_COMPILER_OPTION(wmore, -W<xxx>, $WMORE, CFLAGS="$CFLAGS $WMORE")
+     AC_COMPILER_OPTION(wnolonglong, -Wno-long-long, -Wno-long-long, CFLAGS="$CFLAGS -Wno-long-long")
+ else
+     case "$CFLAGS" in
+         *-g* ) ;;
+            * ) CFLAGS="$CFLAGS -g" ;;
+     esac
+ fi
+ msg="enabled"
+ AC_DEFINE(PTH_DEBUG)
+ ],[
+ if test ".$ac_cv_prog_gcc" = ".yes"; then
+ case "$CFLAGS" in
+     *-pipe* ) ;;
+           * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
+ esac
+ fi
+ case "$CFLAGS" in
+     *-g* ) CFLAGS=`echo "$CFLAGS" |\
+                    sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
+ esac
+ case "$CXXFLAGS" in
+     *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
+                      sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
+ esac
+ msg="disabled"
+ ])dnl
+ AC_MSG_CHECKING(for compilation debug mode)
+ AC_MSG_RESULT([$msg])
+ if test ".$msg" = .enabled; then
+     enable_shared=no
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Profiling Support
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_PROFILING
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_PROFILING,[dnl
+ AC_MSG_CHECKING(for compilation profile mode)
+ AC_ARG_ENABLE(profile,dnl
+ [  --enable-profile        build for profiling (default=no)],
+ [dnl
+ if test ".$ac_cv_prog_gcc" = ".no"; then
+     AC_MSG_ERROR([profiling requires gcc and gprof])
+ fi
+ CFLAGS=`echo "$CFLAGS" | sed -e 's/-O2//g'`
+ CFLAGS="$CFLAGS -O0 -pg"
+ LDFLAGS="$LDFLAGS -pg"
+ msg="enabled"
+ ],[
+ msg="disabled"
+ ])dnl
+ AC_MSG_RESULT([$msg])
+ if test ".$msg" = .enabled; then
+     enable_shared=no
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Build Parameters
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_BUILDPARAM
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_BUILDPARAM,[dnl
+ dnl #   determine build mode
+ AC_MSG_CHECKING(whether to activate batch build mode)
+ AC_ARG_ENABLE(batch,dnl
+ [  --enable-batch          enable batch build mode (default=no)],[dnl
+ ],[dnl
+ enable_batch=no
+ ])dnl
+ if test ".$silent" = .yes; then
+     enable_batch=yes
+ fi
+ AC_MSG_RESULT([$enable_batch])
+ BATCH="$enable_batch"
+ AC_SUBST(BATCH)
+ dnl #   determine build targets
+ TARGET_ALL='$(TARGET_PREQ) $(TARGET_LIBS)'
+ AC_MSG_CHECKING(whether to activate maintainer build targets)
+ AC_ARG_ENABLE(maintainer,dnl
+ [  --enable-maintainer     enable maintainer build targets (default=no)],[dnl
+ ],[dnl
+ enable_maintainer=no
+ ])dnl
+ AC_MSG_RESULT([$enable_maintainer])
+ if test ".$enable_maintainer" = .yes; then
+     TARGET_ALL="$TARGET_ALL \$(TARGET_MANS)"
+ fi
+ AC_MSG_CHECKING(whether to activate test build targets)
+ AC_ARG_ENABLE(tests,dnl
+ [  --enable-tests          enable test build targets (default=yes)],[dnl
+ ],[dnl
+ enable_tests=yes
+ ])dnl
+ AC_MSG_RESULT([$enable_tests])
+ if test ".$enable_tests" = .yes; then
+     TARGET_ALL="$TARGET_ALL \$(TARGET_TEST)"
+ fi
+ AC_SUBST(TARGET_ALL)
+ ])
+ 
+ dnl ##
+ dnl ##  Optimization Support
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_OPTIMIZE
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_OPTIMIZE,[dnl
+ AC_ARG_ENABLE(optimize,dnl
+ [  --enable-optimize       build with optimization (default=no)],
+ [dnl
+ if test ".$ac_cv_prog_gcc" = ".yes"; then
+     #  compiler is gcc
+     case "$CFLAGS" in
+         *-O* ) ;;
+         * ) CFLAGS="$CFLAGS -O2" ;;
+     esac
+     case "$CFLAGS" in
+         *-pipe* ) ;;
+         * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
+     esac
+     OPT_CFLAGS='-funroll-loops -fstrength-reduce -fomit-frame-pointer -ffast-math'
+     AC_COMPILER_OPTION(optimize_std, [-f<xxx> for optimizations], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS")
+     case $PLATFORM in
+         i?86*-*-*|?86*-*-* )
+             OPT_CFLAGS='-malign-functions=4 -malign-jumps=4 -malign-loops=4' 
+             AC_COMPILER_OPTION(optimize_x86, [-f<xxx> for Intel x86 CPU], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS")
+             ;;
+     esac
+ else
+     #  compiler is NOT gcc
+     case "$CFLAGS" in
+         *-O* ) ;;
+            * ) CFLAGS="$CFLAGS -O" ;;
+     esac
+     case $PLATFORM in
+         *-*-solaris* )
+             AC_COMPILER_OPTION(fast, -fast, -fast, CFLAGS="$CFLAGS -fast")
+             ;;
+     esac
+ fi
+ msg="enabled"
+ ],[
+ msg="disabled"
+ ])dnl
+ AC_MSG_CHECKING(for compilation optimization mode)
+ AC_MSG_RESULT([$msg])
+ ])
+ 
+ dnl ##
+ dnl ##  Check for a pre-processor define in a header
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_DEFINE(<define>, <header>)
+ dnl ##  acconfig.h:
+ dnl ##    #undef HAVE_<define>
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_DEFINE,[dnl
+ AC_MSG_CHECKING(for define $1 in $2)
+ AC_CACHE_VAL(ac_cv_define_$1,
+ [AC_EGREP_CPP([YES_IS_DEFINED], [
+ #include <$2>
+ #ifdef $1
+ YES_IS_DEFINED
+ #endif
+ ], ac_cv_define_$1=yes, ac_cv_define_$1=no)])dnl
+ AC_MSG_RESULT($ac_cv_define_$1)
+ if test $ac_cv_define_$1 = yes; then
+     AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]))
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Check for an ANSI C typedef in a header
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_TYPEDEF(<typedef>, <header>)
+ dnl ##  acconfig.h:
+ dnl ##    #undef HAVE_<typedef>
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_TYPEDEF,[dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_MSG_CHECKING(for typedef $1)
+ AC_CACHE_VAL(ac_cv_typedef_$1,
+ [AC_EGREP_CPP(dnl
+ changequote(<<,>>)dnl
+ <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
+ changequote([,]), [
+ #include <$2>
+ ], ac_cv_typedef_$1=yes, ac_cv_typedef_$1=no)])dnl
+ AC_MSG_RESULT($ac_cv_typedef_$1)
+ if test $ac_cv_typedef_$1 = yes; then
+     AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]))
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Check for an ANSI C struct attribute in a structure defined in a header
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_STRUCTATTR(<attr>, <struct>, <header>)
+ dnl ##  acconfig.h:
+ dnl ##    #undef HAVE_<attr>
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_STRUCTATTR,[dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_MSG_CHECKING(for attribute $1 in struct $2 from $3)
+ AC_CACHE_VAL(ac_cv_structattr_$1,[dnl
+ 
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <$3>
+ ],[
+ struct $2 *sp1;
+ struct $2 *sp2;
+ sp1->$1 = sp2->$1;
+ ], ac_cv_structattr_$1=yes, ac_cv_structattr_$1=no)])dnl
+ AC_MSG_RESULT($ac_cv_structattr_$1)
+ if test $ac_cv_structattr_$1 = yes; then
+     AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]))
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Check for argument type of a function
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_ARGTYPE(<header> [...], <func>, <arg-number>,
+ dnl ##                     <max-arg-number>, <action-with-${ac_type}>)
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_ARGTYPE,[dnl
+ AC_REQUIRE_CPP()dnl
+ AC_MSG_CHECKING([for type of argument $3 for $2()])
+ AC_CACHE_VAL([ac_cv_argtype_$2$3],[
+ cat >conftest.$ac_ext <<EOF
+ [#]line __oline__ "configure"
+ #include "confdefs.h"
+ EOF
+ for ifile in $1; do
+     echo "#include <$ifile>" >>conftest.$ac_ext
+ done
+ gpat=''
+ spat=''
+ i=1
+ changequote(, )dnl
+ while test $i -le $4; do
+     gpat="$gpat[^,]*"
+     if test $i -eq $3; then
+         spat="$spat\\([^,]*\\)"
+     else
+         spat="$spat[^,]*"
+     fi
+     if test $i -lt $4; then
+         gpat="$gpat,"
+         spat="$spat,"
+     fi
+     i=`expr $i + 1`
+ done
+ (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |\
+ sed -e ':join' \
+     -e '/,[    ]*$/N' \
+     -e 's/,[   ]*\n[   ]*/, /' \
+     -e 'tjoin' |\
+ egrep "[^a-zA-Z0-9_]$2[        ]*\\($gpat\\)" | head -1 |\
+ sed -e "s/.*[^a-zA-Z0-9_]$2[   ]*($spat).*/\\1/" \
+     -e 's/(\*[a-zA-Z_][a-zA-Z_0-9]*)/(*)/' \
+     -e 's/^[   ]*//' -e 's/[   ]*$//' \
+     -e 's/^/arg:/' \
+     -e 's/^arg:\([^    ]*\)$/type:\1/' \
+     -e 's/^arg:\(.*_t\)*$/type:\1/' \
+     -e 's/^arg:\(.*\*\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]\*\)[_a-zA-Z][_a-zA-Z0-9]*$/type:\1/' \
+     -e 's/^arg:\(.*[   ]char\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]short\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]int\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]long\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]float\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]double\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]unsigned\)$/type:\1/' \
+     -e 's/^arg:\(.*[   ]signed\)$/type:\1/' \
+     -e 's/^arg:\(.*struct[     ][_a-zA-Z][_a-zA-Z0-9]*\)$/type:\1/' \
+     -e 's/^arg:\(.*\)[         ]_[_a-zA-Z0-9]*$/type:\1/' \
+     -e 's/^arg:\(.*\)[         ]\([^   ]*\)$/type:\1/' \
+     -e 's/^type://' >conftest.output
+ ac_cv_argtype_$2$3=`cat conftest.output`
+ changequote([, ])dnl
+ rm -f conftest*
+ ])
+ AC_MSG_RESULT([$ac_cv_argtype_$2$3])
+ ac_type="$ac_cv_argtype_$2$3"
+ [$5]
+ ])
+ 
+ dnl ##
+ dnl ##  Check for existance of a function
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##     AC_CHECK_FUNCTION(<function> [, <action-if-found> [, <action-if-not-found>]])
+ dnl ##     AC_CHECK_FUNCTIONS(<function> [...] [, <action-if-found> [, <action-if-not-found>]])
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_FUNCTIONS,[dnl
+ for ac_func in $1; do
+     AC_CHECK_FUNCTION($ac_func,
+         [changequote(, )dnl
+         ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+         changequote([, ])dnl
+         AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
+ done
+ ])
+ 
+ AC_DEFUN(AC_CHECK_FUNCTION, [dnl
+ AC_MSG_CHECKING([for function $1])
+ AC_CACHE_VAL(ac_cv_func_$1, [dnl
+ AC_TRY_LINK([
+ /* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $1(); below. */
+ #include <assert.h>
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+ /* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply. */
+ char $1();
+ char (*f)();
+ ], [
+ /* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias. */
+ #if defined (__stub_$1) || defined (__stub___$1)
+ choke me
+ #else
+ f = $1;
+ #endif
+ ], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
+ if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
+   AC_MSG_RESULT(yes)
+   ifelse([$2], , :, [$2])
+ else
+   AC_MSG_RESULT(no)
+ ifelse([$3], , , [$3
+ ])dnl
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Decision Hierachy
+ dnl ##
+ 
+ define(AC_IFALLYES,[dnl
+ ac_rc=yes
+ for ac_spec in $1; do
+     ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'`
+     ac_item=`echo "$ac_spec" | sed -e 's/^.*://'`
+     case $ac_type in
+         header [)]
+             ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
+             ac_var="ac_cv_header_$ac_item"
+             ;;
+         file [)]
+             ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
+             ac_var="ac_cv_file_$ac_item"
+             ;;
+         func    [)] ac_var="ac_cv_func_$ac_item"   ;;
+         lib     [)] ac_var="ac_cv_lib_$ac_item"    ;;
+         define  [)] ac_var="ac_cv_define_$ac_item" ;;
+         typedef [)] ac_var="ac_cv_typedef_$ac_item" ;;
+         custom  [)] ac_var="$ac_item" ;;
+     esac
+     eval "ac_val=\$$ac_var"
+     if test ".$ac_val" != .yes; then
+         ac_rc=no
+         break
+     fi
+ done
+ if test ".$ac_rc" = .yes; then
+     :
+     $2
+ else
+     :
+     $3
+ fi
+ ])
+ 
+ define(AC_BEGIN_DECISION,[dnl
+ ac_decision_item='$1'
+ ac_decision_msg='FAILED'
+ ac_decision=''
+ ])
+ 
+ define(AC_DECIDE,[dnl
+ ac_decision='$1'
+ ac_decision_msg='$2'
+ ac_decision_$1=yes
+ ac_decision_$1_msg='$2'
+ ])
+ 
+ define(AC_DECISION_OVERRIDE,[dnl
+     ac_decision=''
+     for ac_item in $1; do
+          eval "ac_decision_this=\$ac_decision_${ac_item}"
+          if test ".$ac_decision_this" = .yes; then
+              ac_decision=$ac_item
+              eval "ac_decision_msg=\$ac_decision_${ac_item}_msg"
+          fi
+     done
+ ])
+ 
+ define(AC_DECISION_FORCE,[dnl
+ ac_decision="$1"
+ eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\""
+ ])
+ 
+ define(AC_END_DECISION,[dnl
+ if test ".$ac_decision" = .; then
+     echo "[$]0:Error: decision on $ac_decision_item failed." 1>&2
+     echo "[$]0:Hint: see config.log for more details!" 1>&2
+     exit 1
+ else
+     if test ".$ac_decision_msg" = .; then
+         ac_decision_msg="$ac_decision"
+     fi
+     AC_MSG_RESULT([decision on $ac_decision_item... ${TB}$ac_decision_msg${TN}])
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Check for existance of a file
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_TEST_FILE(<file>, <success-action>, <failure-action>)
+ dnl ##
+ 
+ AC_DEFUN(AC_TEST_FILE, [
+ ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+ AC_MSG_CHECKING([for $1])
+ AC_CACHE_VAL(ac_cv_file_$ac_safe, [
+ if test -r $1; then
+     eval "ac_cv_file_$ac_safe=yes"
+ else
+     eval "ac_cv_file_$ac_safe=no"
+ fi
+ ])dnl
+ if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+ else
+     AC_MSG_RESULT(no)
+     ifelse([$3], , :, [$3])
+ fi
+ ])
+ 
+ dnl ##
+ dnl ##  Check for socket/network size type
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_SOCKLENTYPE(<action-with-${ac_type}>)
+ dnl ##
+ 
+ dnl #   Background:
+ dnl #   this exists because of shortsightedness on the POSIX committee.
+ dnl #   BSD systems used "int *" as the parameter to accept(2),
+ dnl #   getsockname(2), getpeername(2) et al. Consequently many Unix
+ dnl #   flavors took an "int *" for that parameter. The POSIX committee
+ dnl #   decided that "int" was just too generic and had to be replaced
+ dnl #   with "size_t" almost everywhere. There's no problem with that
+ dnl #   when you're passing by value. But when you're passing by
+ dnl #   reference (as it is the case for accept(2) and friends) this
+ dnl #   creates a gross source incompatibility with existing programs.
+ dnl #   On 32-bit architectures it creates only a warning. On 64-bit
+ dnl #   architectures it creates broken code -- because "int *" is a
+ dnl #   pointer to a 64-bit quantity and "size_t *" is usually a pointer
+ dnl #   to a 32-bit quantity. Some Unix flavors adopted "size_t *" for
+ dnl #   the sake of POSIX compliance. Others ignored it because it was
+ dnl #   such a broken interface. Chaos ensued. POSIX finally woke up
+ dnl #   and decided that it was wrong and created a new type socklen_t.
+ dnl #   The only useful value for socklen_t is "int", and that's how
+ dnl #   everyone who has a clue implements it. It is almost always the
+ dnl #   case that this type should be defined to be an "int", unless the
+ dnl #   system being compiled for was created in the window of POSIX
+ dnl #   madness.
+ 
+ AC_DEFUN(AC_CHECK_SOCKLENTYPE,[dnl
+ AC_CHECK_TYPEDEF(socklen_t, sys/socket.h)
+ AC_CHECK_ARGTYPE(sys/types.h sys/socket.h, accept, 3, 3, [:])
+ AC_MSG_CHECKING(for fallback socklen_t)
+ AC_CACHE_VAL(ac_cv_check_socklentype, [
+ if test ".$ac_cv_typedef_socklen_t" = .yes; then
+     ac_cv_check_socklentype='socklen_t'
+ elif test ".$ac_type" != .; then
+     ac_cv_check_socklentype=`echo "$ac_type" | sed -e 's/[     ]*\*$//'`
+ else
+     ac_cv_check_socklentype='int'
+ fi
+ ])
+ AC_MSG_RESULT([$ac_cv_check_socklentype])
+ ac_type="$ac_cv_check_socklentype"
+ ifelse([$1], , :, [$1])
+ ])
+ 
+ dnl ##
+ dnl ##  Check for filedescriptor number type
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_NFDSTYPE(<action-with-${ac_type}>)
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_NFDSTYPE,[dnl
+ AC_CHECK_TYPEDEF(nfds_t, poll.h)
+ AC_CHECK_ARGTYPE(sys/types.h poll.h, poll, 2, 3, [:])
+ AC_MSG_CHECKING(for fallback nfds_t)
+ AC_CACHE_VAL(ac_cv_check_nfdstype, [
+ if test ".$ac_cv_typedef_nfds_t" = .yes; then
+     ac_cv_check_nfdstype='nfds_t'
+ elif test ".$ac_type" != .; then
+     ac_cv_check_nfdstype=`echo "$ac_type" | sed -e 's/[        ]*\*$//'`
+ else
+     ac_cv_check_nfdstype='unsigned int'
+ fi
+ ])
+ AC_MSG_RESULT([$ac_cv_check_nfdstype])
+ ac_type="$ac_cv_check_nfdstype"
+ ifelse([$1], , :, [$1])
+ ])
+ 
+ dnl ##
+ dnl ##  Check for direction of stack growth
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_STACKGROWTH(<define>)
+ dnl ##  acconfig.h:
+ dnl ##    #undef <define>
+ dnl ##  source.c:
+ dnl ##    #include "config.h"
+ dnl ##    #if <define> < 0
+ dnl ##        ...stack grow down...
+ dnl ##    #else
+ dnl ##        ...stack grow up...
+ dnl ##    #endif
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_STACKGROWTH,[dnl
+ AC_MSG_CHECKING(for direction of stack growth)
+ AC_CACHE_VAL(ac_cv_check_stackgrowth, [
+ cross_compile=no
+ AC_TRY_RUN(
+ changequote(<<, >>)dnl
+ <<
+ #include <stdio.h>
+ #include <stdlib.h>
+ static int iterate = 10;
+ static int growsdown(int *x)
+ {
+     auto int y;
+     y = (x > &y);
+     if (--iterate > 0)
+         y = growsdown(&y);
+     if (y != (x > &y))
+         exit(1);
+     return y;
+ }
+ int main(int argc, char *argv[])
+ {
+     FILE *f;
+     auto int x;
+     if ((f = fopen("conftestval", "w")) == NULL)
+         exit(1);
+     fprintf(f, "%s\n", growsdown(&x) ? "down" : "up");;
+     fclose(f);
+     exit(0);
+ }
+ >>
+ changequote([, ])dnl
+ ,
+ ac_cv_check_stackgrowth=`cat conftestval`,
+ ac_cv_check_stackgrowth=down,
+ ac_cv_check_stackgrowth=down
+ )dnl
+ ])dnl
+ AC_MSG_RESULT([$ac_cv_check_stackgrowth])
+ if test ".$ac_cv_check_stackgrowth" = ".down"; then
+     val="-1"
+ else
+     val="+1"
+ fi
+ AC_DEFINE_UNQUOTED($1, $val)
+ ])
+ 
+ dnl ##
+ dnl ##  Check whether and how a POSIX compliant sigsetjmp(3) can be achieved
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_SJLJ(<success-action>, <failure-action>, <type-var>)
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_SJLJ,[dnl
+ AC_MSG_CHECKING(for signal-mask aware setjmp(3)/longjmp(3))
+ AC_CACHE_VAL(ac_cv_check_sjlj, [
+ AC_IFALLYES(func:setjmp func:longjmp, ac_cv_check_sjlj=sjlje, ac_cv_check_sjlj=none)
+ cross_compile=no
+ for testtype in ssjlj sjlj usjlj; do
+ OCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -DTEST_${testtype}"
+ AC_TRY_RUN(
+ changequote(<<, >>)dnl
+ <<
+ #if defined(TEST_ssjlj)
+ #define __JMP_BUF          sigjmp_buf
+ #define __SETJMP(buf)      sigsetjmp(buf,1)
+ #define __LONGJMP(buf,val) siglongjmp(buf,val)
+ #elif defined(TEST_sjlj)
+ #define __JMP_BUF          jmp_buf
+ #define __SETJMP(buf)      setjmp(buf)
+ #define __LONGJMP(buf,val) longjmp(buf,val)
+ #elif defined(TEST_usjlj)
+ #define __JMP_BUF          jmp_buf
+ #define __SETJMP(buf)      _setjmp(buf)
+ #define __LONGJMP(buf,val) _longjmp(buf,val)
+ #endif
+ 
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <setjmp.h>
+ #include <unistd.h>
+ 
+ static __JMP_BUF jb;
+ 
+ static void sighandler(int sig)
+ {
+     sigset_t sigs;
+ 
+     /* get signal mask */
+     sigprocmask(SIG_SETMASK, NULL, &sigs);
+ 
+     /* make sure USR1 is still blocked */
+     if (!sigismember(&sigs, SIGUSR1))
+         exit(1);
+ 
+     /* block USR2 for us */
+     sigaddset(&sigs, SIGUSR2);
+     sigprocmask(SIG_SETMASK, &sigs, NULL);
+ 
+     /* jump back to main */
+     __LONGJMP(jb, 1);
+     exit(1);
+ }
+ 
+ int main(int argc, char *argv[])
+ {
+     FILE *fp;
+     sigset_t sigs;
+     struct sigaction sa;
+ 
+     /* the default is that it fails */
+     if ((fp = fopen("conftestval", "w")) == NULL)
+         exit(1);
+     fprintf(fp, "failed\n");
+     fclose(fp);
+ 
+     /* block USR1 and unblock USR2 signal */
+     sigprocmask(SIG_SETMASK, NULL, &sigs);
+     sigaddset(&sigs, SIGUSR1);
+     sigdelset(&sigs, SIGUSR2);
+     sigprocmask(SIG_SETMASK, &sigs, NULL);
+ 
+     /* set jump buffer */
+     if (__SETJMP(jb) == 0) {
+ 
+         /* install signal handler for USR1 */
+         memset((void *)&sa, 0, sizeof(struct sigaction));
+         sigemptyset(&sa.sa_mask);
+         sa.sa_handler = sighandler;
+         sa.sa_flags = 0;
+         sigaction(SIGUSR1, &sa, NULL);
+ 
+         /* send USR1 signal (which is still blocked) */
+         kill(getpid(), SIGUSR1);
+ 
+         /* unblock USR1 and wait for it */
+         sigprocmask(SIG_SETMASK, NULL, &sigs);
+         sigdelset(&sigs, SIGUSR1);
+         sigsuspend(&sigs);
+         exit(1);
+     }
+ 
+     /* get signal mask again */
+     sigprocmask(SIG_SETMASK, NULL, &sigs);
+ 
+     /* make sure USR2 is again unblocked */
+     if (sigismember(&sigs, SIGUSR2))
+         exit(1);
+ 
+     /* Fine... */
+     if ((fp = fopen("conftestval", "w")) == NULL)
+         exit(1);
+     fprintf(fp, "ok\n");
+     fclose(fp);
+     exit(0);
+ }
+ >>
+ changequote([, ]),
+ rc=`cat conftestval`,
+ rc=failed,
+ rc=failed
+ )dnl
+ CFLAGS="$OCFLAGS"
+ if test ".$rc" = .ok; then
+     ac_cv_check_sjlj=$testtype
+     break
+ fi
+ done
+ case $PLATFORM in
+     *-*-linux* )
+         braindead=no
+         case "x`uname -r`" in
+ changequote(, )dnl
+             x2.[23456789]* ) ;;
+ changequote([, ])
+             * ) braindead=yes ;;
+         esac
+         case `grep __GLIBC_MINOR /usr/include/features.h | grep '#define' |\
+               awk '{ printf("%s", [$]3 >= 1 ? "yes" : "no"); }'` in
+             yes ) ;;
+             * ) braindead=yes ;;
+         esac
+         case $braindead in
+             yes ) ac_cv_check_sjlj=sjljlx ;;
+             no  ) ac_cv_check_sjlj=ssjlj  ;;
+         esac
+         ;;
+     *-*-isc* )
+         ac_cv_check_sjlj=sjljisc
+         ;;
+     *-*-interix )
+         #   Interix is a POSIX sub-system on Windows-NT which
+         #   can use the Interactive UNIX dispatching code.
+         ac_cv_check_sjlj=sjljisc
+         ;;
+     *-*-cygwin* )
+         ac_cv_check_sjlj=sjljw32
+         ;;
+ esac
+ ])dnl
+ $3="$ac_cv_check_sjlj"
+ if test ".$ac_cv_check_sjlj" != .none; then
+     AC_MSG_RESULT([yes: $ac_cv_check_sjlj])
+     ifelse([$1], , :, [$1])
+ else
+     AC_MSG_RESULT([no])
+     ifelse([$2], , :, [$2])
+ fi
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Check for number of signals (NSIG)
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_NSIG(<define>)
+ dnl ##  acconfig.h:
+ dnl ##    #undef <define>
+ dnl ##  source.c:
+ dnl ##    #include "config.h"
+ dnl ##    ...<define>...
+ 
+ AC_DEFUN(AC_CHECK_NSIG,[dnl
+ AC_MSG_CHECKING(for number of signals)
+ cross_compile=no
+ AC_TRY_RUN(
+ changequote(<<, >>)dnl
+ <<
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <signal.h>
+ 
+ int main(int argc, char *argv[])
+ {
+     FILE *fp;
+     int nsig;
+ 
+ #if defined(NSIG)
+     nsig = NSIG;
+ #elif defined(_NSIG)
+     nsig = _NSIG;
+ #else
+     nsig = (sizeof(sigset_t)*8);
+     if (nsig < 32)
+         nsig = 32;
+ #endif
+     if ((fp = fopen("conftestval", "w")) == NULL)
+         exit(1);
+     fprintf(fp, "%d\n", nsig);
+     fclose(fp);
+     exit(0);
+ }
+ >>
+ changequote([, ])dnl
+ ,
+ nsig=`cat conftestval`,
+ nsig=32,
+ nsig=32
+ )dnl
+ AC_MSG_RESULT([$nsig])
+ AC_DEFINE_UNQUOTED($1, $nsig)
+ ])
+ 
+ dnl ##
+ dnl ##  Check for an external/extension library.
+ dnl ##  - is aware of <libname>-config style scripts
+ dnl ##  - searches under standard paths include, lib, etc.
+ dnl ##  - searches under subareas like .libs, etc.
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##      AC_CHECK_EXTLIB(<realname>, <libname>, <func>, <header>,
+ dnl ##                      [<success-action> [, <fail-action>]])
+ dnl ##  Makefile.in:
+ dnl ##      CFLAGS  = @CFLAGS@
+ dnl ##      LDFLAGS = @LDFLAGS@
+ dnl ##      LIBS    = @LIBS@
+ dnl ##  shell:
+ dnl ##      $ ./configure --with-<libname>[=DIR]
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_EXTLIB,[dnl
+ AC_ARG_WITH($2,dnl
+ [  --with-]substr([$2[[=DIR]]                 ], 0, 19)[build against $1 library (default=no)],
+     if test ".$with_$2" = .yes; then
+         #   via config script
+         $2_version=`($2-config --version) 2>/dev/null`
+         if test ".$$2_version" != .; then
+             CPPFLAGS="$CPPFLAGS `$2-config --cflags`"
+             CFLAGS="$CFLAGS `$2-config --cflags`"
+             LDFLAGS="$LDFLAGS `$2-config --ldflags`"
+         fi
+     else
+         if test -d "$with_$2"; then
+             found=0
+             #   via config script
+             for dir in $with_$2/bin $with_$2; do
+                 if test -f "$dir/$2-config"; then
+                     $2_version=`($dir/$2-config --version) 2>/dev/null`
+                     if test ".$$2_version" != .; then
+                         CPPFLAGS="$CPPFLAGS `$dir/$2-config --cflags`"
+                         CFLAGS="$CFLAGS `$dir/$2-config --cflags`"
+                         LDFLAGS="$LDFLAGS `$dir/$2-config --ldflags`"
+                         found=1
+                         break
+                     fi
+                 fi
+             done
+             #   via standard paths
+             if test ".$found" = .0; then
+                 for dir in $with_$2/include/$2 $with_$2/include $with_$2; do
+                     if test -f "$dir/$4"; then
+                         CPPFLAGS="$CPPFLAGS -I$dir"
+                         CFLAGS="$CFLAGS -I$dir"
+                         found=1
+                         break
+                     fi
+                 done
+                 for dir in $with_$2/lib/$2 $with_$2/lib $with_$2; do
+                     if test -f "$dir/lib$2.a" -o -f "$dir/lib$2.so"; then
+                         LDFLAGS="$LDFLAGS -L$dir"
+                         found=1
+                         break
+                     fi
+                 done
+             fi
+             #   in any subarea
+             if test ".$found" = .0; then
+ changequote(, )dnl
+                 for file in x `find $with_$2 -name "$4" -type f -print`; do
+                     test .$file = .x && continue
+                     dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
+                     CPPFLAGS="$CPPFLAGS -I$dir"
+                     CFLAGS="$CFLAGS -I$dir"
+                 done
+                 for file in x `find $with_$2 -name "lib$2.[[aso]]" -type f -print`; do
+                     test .$file = .x && continue
+                     dir=`echo $file | sed -e 's;[[^/]]*$;;' -e 's;\(.\)/$;\1;'`
+                     LDFLAGS="$LDFLAGS -L$dir"
+                 done
+ changequote([, ])dnl
+             fi
+         fi
+     fi
+     AC_HAVE_HEADERS($4)
+     AC_CHECK_LIB($2, $3)
+     AC_IFALLYES(header:$4 lib:$2_$3, with_$2=yes, with_$2=no)
+     if test ".$with_$2" = .no; then
+         AC_ERROR([Unable to find $1 library])
+     fi
+ ,
+ if test ".$with_$2" = .; then
+     with_$2=no
+ fi
+ )dnl
+ AC_MSG_CHECKING(whether to build against $1 library)
+ if test ".$with_$2" = .yes; then
+     ifelse([$5], , :, [$5])
+ else
+     ifelse([$6], , :, [$6])
+ fi
+ AC_MSG_RESULT([$with_$2])
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Check whether SVR4/SUSv2 makecontext(2), swapcontext(2) and
+ dnl ##  friends can be used for user-space context switching
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##     AC_CHECK_MCSC(<success-action>, <failure-action>)
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_MCSC, [
+ AC_MSG_CHECKING(for usable SVR4/SUSv2 makecontext(2)/swapcontext(2))
+ AC_CACHE_VAL(ac_cv_check_mcsc, [
+ AC_TRY_RUN([
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <ucontext.h>
+ 
+ ucontext_t uc_child;
+ ucontext_t uc_main;
+ 
+ void child(void *arg)
+ {
+     if (arg != (void *)12345)
+         exit(1);
+     if (swapcontext(&uc_child, &uc_main) != 0)
+         exit(1);
+ }
+ 
+ int main(int argc, char *argv[])
+ {
+     FILE *fp;
+     void *stack;
+ 
+     /* the default is that it fails */
+     if ((fp = fopen("conftestval", "w")) == NULL)
+         exit(1);
+     fprintf(fp, "no\n");
+     fclose(fp);
+ 
+     /* configure a child user-space context */
+     if ((stack = malloc(64*1024)) == NULL)
+         exit(1);
+     if (getcontext(&uc_child) != 0)
+         exit(1);
+     uc_child.uc_link = NULL;
+     uc_child.uc_stack.ss_sp = (char *)stack+(32*1024);
+     uc_child.uc_stack.ss_size = 32*1024;
+     uc_child.uc_stack.ss_flags = 0;
+     makecontext(&uc_child, child, 2, (void *)12345);
+ 
+     /* switch into the user context */
+     if (swapcontext(&uc_main, &uc_child) != 0)
+         exit(1);
+ 
+     /* Fine, child came home */
+     if ((fp = fopen("conftestval", "w")) == NULL)
+         exit(1);
+     fprintf(fp, "yes\n");
+     fclose(fp);
+ 
+     /* die successfully */
+     exit(0);
+ }
+ ],
+ ac_cv_check_mcsc=`cat conftestval`,
+ ac_cv_check_mcsc=no,
+ ac_cv_check_mcsc=no
+ )dnl
+ ])dnl
+ AC_MSG_RESULT([$ac_cv_check_mcsc])
+ if test ".$ac_cv_check_mcsc" = .yes; then
+     ifelse([$1], , :, [$1])
+ else
+     ifelse([$2], , :, [$2])
+ fi
+ ])dnl
+ 
+ dnl ##
+ dnl ##  Check how stacks have to be setup for the functions
+ dnl ##  sigstack(2), sigaltstack(2) and makecontext(2).
+ dnl ##
+ dnl ##  configure.in:
+ dnl ##    AC_CHECK_STACKSETUP(sigstack|sigaltstack|makecontext, <macro-addr>, <macro-size>)
+ dnl ##  acconfig.h:
+ dnl ##    #undef HAVE_{SIGSTACK|SIGALTSTACK|MAKECONTEXT}
+ dnl ##    #undef HAVE_STACK_T
+ dnl ##  header.h.in:
+ dnl ##    @<macro-addr>@
+ dnl ##    @<macro-size>@
+ dnl ##  source.c:
+ dnl ##    #include "header.h"
+ dnl ##    xxx.sp_ss   = <macro-addr>(skaddr, sksize);
+ dnl ##    xxx.sp_size = <macro-size>(skaddr, sksize);
+ dnl ##
+ 
+ AC_DEFUN(AC_CHECK_STACKSETUP,[dnl
+ dnl #   check for consistent usage
+ ifelse($1,[sigstack],,[
+ ifelse($1,[sigaltstack],,[
+ ifelse($1,[makecontext],,[
+ errprint(__file__:__line__: [AC_CHECK_STACKSETUP: only sigstack, sigaltstack and makecontext supported
+ ])])])])
+ dnl #   we require the C compiler and the standard headers
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ dnl #   we at least require the function to check
+ AC_CHECK_FUNCTIONS($1)
+ dnl #   sigaltstack on some platforms uses stack_t instead of struct sigaltstack
+ ifelse($1, sigaltstack, [
+     AC_ONCE(stacksetup_stack_t, [
+         AC_CHECK_TYPEDEF(stack_t, signal.h)
+     ])
+ ])
+ dnl #   display processing header
+ AC_MSG_CHECKING(for stack setup via $1)
+ dnl #   but cache the whole results
+ AC_CACHE_VAL(ac_cv_stacksetup_$1,[
+ if test ".$ac_cv_func_$1" = .no; then
+     dnl #   no need to check anything when function is already missing
+     ac_cv_stacksetup_$1="N.A.:/*N.A.*/,/*N.A.*/"
+ else
+     dnl #   setup compile environment
+     OCFLAGS="$CFLAGS"
+     CFLAGS="$CFLAGS -DTEST_$1"
+     cross_compile=no
+     dnl #   compile and run the test program
+     AC_TRY_RUN([
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #if defined(TEST_sigstack) || defined(TEST_sigaltstack)
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <unistd.h>
+ #endif
+ #if defined(TEST_makecontext)
+ #include <ucontext.h>
+ #endif
+ union alltypes {
+     long   l;
+     double d;
+     void  *vp;
+     void (*fp)(void);
+     char  *cp;
+ };
+ static volatile char *handler_addr = (char *)0xDEAD;
+ #if defined(TEST_sigstack) || defined(TEST_sigaltstack)
+ static volatile int handler_done = 0;
+ void handler(int sig)
+ {
+     char garbage[1024];
+     int i;
+     auto int dummy;
+     for (i = 0; i < 1024; i++)
+         garbage[i] = 'X';
+     handler_addr = (char *)&dummy;
+     handler_done = 1;
+     return;
+ }
+ #endif
+ #if defined(TEST_makecontext)
+ static ucontext_t uc_handler;
+ static ucontext_t uc_main;
+ void handler(void)
+ {
+     char garbage[1024];
+     int i;
+     auto int dummy;
+     for (i = 0; i < 1024; i++)
+         garbage[i] = 'X';
+     handler_addr = (char *)&dummy;
+     swapcontext(&uc_handler, &uc_main);
+     return;
+ }
+ #endif
+ int main(int argc, char *argv[])
+ {
+     FILE *f;
+     char *skaddr;
+     char *skbuf;
+     int sksize;
+     char result[1024];
+     int i;
+     sksize = 32768;
+     skbuf = (char *)malloc(sksize*2+2*sizeof(union alltypes));
+     if (skbuf == NULL)
+         exit(1);
+     for (i = 0; i < sksize*2+2*sizeof(union alltypes); i++)
+         skbuf[i] = 'A';
+     skaddr = skbuf+sizeof(union alltypes);
+ #if defined(TEST_sigstack) || defined(TEST_sigaltstack)
+     {
+         struct sigaction sa;
+ #if defined(TEST_sigstack)
+         struct sigstack ss;
+ #elif defined(TEST_sigaltstack) && defined(HAVE_STACK_T)
+         stack_t ss;
+ #else
+         struct sigaltstack ss;
+ #endif
+ #if defined(TEST_sigstack)
+         ss.ss_sp      = (void *)(skaddr + sksize);
+         ss.ss_onstack = 0;
+         if (sigstack(&ss, NULL) < 0)
+             exit(1);
+ #elif defined(TEST_sigaltstack)
+         ss.ss_sp    = (void *)(skaddr + sksize);
+         ss.ss_size  = sksize;
+         ss.ss_flags = 0;
+         if (sigaltstack(&ss, NULL) < 0)
+             exit(1);
+ #endif
+         memset((void *)&sa, 0, sizeof(struct sigaction));
+         sa.sa_handler = handler;
+         sa.sa_flags = SA_ONSTACK;
+         sigemptyset(&sa.sa_mask);
+         sigaction(SIGUSR1, &sa, NULL);
+         kill(getpid(), SIGUSR1);
+         while (!handler_done)
+             /*nop*/;
+     }
+ #endif
+ #if defined(TEST_makecontext)
+     {
+         if (getcontext(&uc_handler) != 0)
+             exit(1);
+         uc_handler.uc_link = NULL;
+         uc_handler.uc_stack.ss_sp    = (void *)(skaddr + sksize);
+         uc_handler.uc_stack.ss_size  = sksize;
+         uc_handler.uc_stack.ss_flags = 0;
+         makecontext(&uc_handler, handler, 1);
+         swapcontext(&uc_main, &uc_handler);
+     }
+ #endif
+     if (handler_addr == (char *)0xDEAD)
+         exit(1);
+     if (handler_addr < skaddr+sksize) {
+         /* stack was placed into lower area */
+         if (*(skaddr+sksize) != 'A')
+              sprintf(result, "(skaddr)+(sksize)-%d,(sksize)-%d",
+                      sizeof(union alltypes), sizeof(union alltypes));
+         else
+              strcpy(result, "(skaddr)+(sksize),(sksize)");
+     }
+     else {
+         /* stack was placed into higher area */
+         if (*(skaddr+sksize*2) != 'A')
+             sprintf(result, "(skaddr),(sksize)-%d", sizeof(union alltypes));
+         else
+             strcpy(result, "(skaddr),(sksize)");
+     }
+     if ((f = fopen("conftestval", "w")) == NULL)
+         exit(1);
+     fprintf(f, "%s\n", result);
+     fclose(f);
+     exit(0);
+ }
+ ],[
+ dnl #   test successully passed
+ ac_cv_stacksetup_$1=`cat conftestval`
+ ac_cv_stacksetup_$1="ok:$ac_cv_stacksetup_$1"
+ ],[
+ dnl #   test failed
+ ac_cv_stacksetup_$1='guessed:(skaddr),(sksize)'
+ ],[
+ dnl #   cross-platform => failed
+ ac_cv_stacksetup_$1='guessed:(skaddr),(sksize)'
+ ])dnl
+ dnl #   restore original compile environment
+ CFLAGS="$OCFLAGS"
+ ])dnl
+ fi
+ dnl #   extract result ingredients of single cached result value
+ type=`echo $ac_cv_stacksetup_$1 | sed -e 's;:.*$;;'`
+ addr=`echo $ac_cv_stacksetup_$1 | sed -e 's;^.*:;;' -e 's;,.*$;;'`
+ size=`echo $ac_cv_stacksetup_$1 | sed -e 's;^.*:;;' -e 's;^.*,;;'`
+ dnl #   export result ingredients
+ $2="#define $2(skaddr,sksize) ($addr)"
+ $3="#define $3(skaddr,sksize) ($size)"
+ AC_SUBST($2)dnl
+ AC_SUBST($3)dnl
+ dnl #   display result indicator
+ AC_MSG_RESULT([$type])
+ dnl #   display results in detail
+ AC_MSG_VERBOSE([$]$2)
+ AC_MSG_VERBOSE([$]$3)
+ ])
+ 
+ divert
+ 


ossp-pkg/pth/configure is a binary file


ossp-pkg/pth/pth-config.1 -> 1.124

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,324 ----
+ .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 PTH-CONFIG 1 "01-Jul-2000" "GNU Pth 1.4a2" "GNU Portable Threads"
+ .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"
+ \fBpth-config\fR \- Pth library build utility
+ .SH "VERSION"
+ GNU Pth 1.4a2 (01-Jul-2000)
+ .SH "SYNOPSIS"
+ \fBpth-config\fR
+ [\fB--help\fR]
+ [\fB--version\fR]
+ [\fB--all\fR]
+ [\fB--prefix\fR]
+ [\fB--exec-prefix\fR]
+ [\fB--bindir\fR]
+ [\fB--libdir\fR]
+ [\fB--includedir\fR]
+ [\fB--mandir\fR]
+ [\fB--datadir\fR]
+ [\fB--acdir\fR]
+ [\fB--cflags\fR]
+ [\fB--ldflags\fR]
+ [\fB--libs\fR]
+ .SH "DESCRIPTION"
+ The \fBpth-config\fR program is a little helper utility for easy configuring and
+ building applications based on the \fIpth\fR\|(3) library.  It can be used to query the
+ C compiler and linker flags which are required to correctly compile and link
+ the application against the \fIpth\fR\|(3) library.
+ .SH "OPTIONS"
+ \fBpth-config\fR accepts the following options:
+ .Ip "\fB--help\fR" 4
+ Prints the short usage information.
+ .Ip "\fB--version\fR" 4
+ Prints the version number and date of the installed \fIpth\fR\|(3) library.
+ .Ip "\fB--all\fR" 4
+ Forces the output of all flags, that is, including extra flags which are not
+ \fBPth\fR specific.
+ .Ip "\fB--prefix\fR" 4
+ Prints the installation prefix of architecture independent files
+ .Ip "\fB--exec-prefix\fR" 4
+ Prints the installation prefix of architecture dependent files.
+ .Ip "\fB--bindir\fR" 4
+ Prints the installation directory of binaries.
+ .Ip "\fB--libdir\fR" 4
+ Prints the installation directory of libraries.
+ .Ip "\fB--includedir\fR" 4
+ Prints the installation directory of include headers.
+ .Ip "\fB--mandir\fR" 4
+ Prints the installation directory of manual pages.
+ .Ip "\fB--datadir\fR" 4
+ Prints the installation directory of shared data.
+ .Ip "\fB--acdir\fR" 4
+ Prints the installation directory of \fBautoconf\fR data.
+ .Ip "\fB--cflags\fR" 4
+ Prints the C compiler flags which are needed to compile the \fIpth\fR\|(3)\-based
+ application. The output is usually added to the \f(CWCFLAGS\fR variable of the
+ applications \f(CWMakefile\fR.
+ .Ip "\fB--ldflags\fR" 4
+ Prints the linker flags (\f(CW-L\fR) which are needed to link the application with
+ the \fIpth\fR\|(3) library. The output is usually added to the \f(CWLDFLAGS\fR variable of
+ the applications \f(CWMakefile\fR.
+ .Ip "\fB--libs\fR" 4
+ Prints the library flags (\f(CW-l\fR) which are needed to link the application with
+ the \fIpth\fR\|(3) library. The output is usually added to the \f(CWLIBS\fR variable of the
+ applications \f(CWMakefile\fR.
+ .SH "EXAMPLE"
+ .PP
+ .Vb 4
+ \& CC      = cc
+ \& CFLAGS  = -O `pth-config --cflags`
+ \& LDFLAGS = `pth-config --ldflags`
+ \& LIBS    = -lm `pth-config --libs`
+ .Ve
+ .Vb 5
+ \& all: foo
+ \& foo: foo.o
+ \&     $(CC) $(LDFLAGS) -o foo foo.o $(LIBS)
+ \& foo.o: foo.c
+ \&     $(CC) $(CFLAGS) -c foo.c
+ .Ve
+ .SH "SEE ALSO"
+ \fIpth\fR\|(3), \fIcc\fR\|(1).
+ .SH "AUTHOR"
+ .PP
+ .Vb 3
+ \& Ralf S. Engelschall
+ \& rse@engelschall.com
+ \& www.engelschall.com
+ .Ve
+ 
+ .rn }` ''
+ .IX Title "PTH-CONFIG 1"
+ .IX Name "B<pth-config> - Pth library build utility"
+ 
+ .IX Header "NAME"
+ 
+ .IX Header "VERSION"
+ 
+ .IX Header "SYNOPSIS"
+ 
+ .IX Header "DESCRIPTION"
+ 
+ .IX Header "OPTIONS"
+ 
+ .IX Item "\fB--help\fR"
+ 
+ .IX Item "\fB--version\fR"
+ 
+ .IX Item "\fB--all\fR"
+ 
+ .IX Item "\fB--prefix\fR"
+ 
+ .IX Item "\fB--exec-prefix\fR"
+ 
+ .IX Item "\fB--bindir\fR"
+ 
+ .IX Item "\fB--libdir\fR"
+ 
+ .IX Item "\fB--includedir\fR"
+ 
+ .IX Item "\fB--mandir\fR"
+ 
+ .IX Item "\fB--datadir\fR"
+ 
+ .IX Item "\fB--acdir\fR"
+ 
+ .IX Item "\fB--cflags\fR"
+ 
+ .IX Item "\fB--ldflags\fR"
+ 
+ .IX Item "\fB--libs\fR"
+ 
+ .IX Header "EXAMPLE"
+ 
+ .IX Header "SEE ALSO"
+ 
+ .IX Header "AUTHOR"
+ 


ossp-pkg/pth/pth.3 -> 1.218

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,2435 ----
+ .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 pth 3 "01-Jul-2000" "GNU Pth 1.4a2" "GNU Portable Threads"
+ .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"
+ \fBpth\fR \- GNU Portable Threads
+ .SH "VERSION"
+ GNU Pth 1.4a2 (01-Jul-2000)
+ .SH "SYNOPSIS"
+ .Ip "\fBGlobal Library Management\fR" 4
+ pth_init,
+ pth_kill,
+ pth_ctrl,
+ pth_version.
+ .Ip "\fBThread Attribute Handling\fR" 4
+ pth_attr_of,
+ pth_attr_new,
+ pth_attr_init,
+ pth_attr_set,
+ pth_attr_get,
+ pth_attr_destroy.
+ .Ip "\fBThread Control\fR" 4
+ pth_spawn,
+ pth_once,
+ pth_self,
+ pth_suspend,
+ pth_resume,
+ pth_yield,
+ pth_nap,
+ pth_wait,
+ pth_cancel,
+ pth_abort,
+ pth_raise,
+ pth_join,
+ pth_exit.
+ .Ip "\fBUtilities\fR" 4
+ pth_fdmode,
+ pth_time,
+ pth_timeout,
+ pth_sfiodisc.
+ .Ip "\fBCancellation Management\fR" 4
+ pth_cancel_point,
+ pth_cancel_state.
+ .Ip "\fBEvent Handling\fR" 4
+ pth_event,
+ pth_event_typeof,
+ pth_event_extract,
+ pth_event_concat,
+ pth_event_isolate,
+ pth_event_walk,
+ pth_event_occurred,
+ pth_event_free.
+ .Ip "\fBKey-Based Storage\fR" 4
+ pth_key_create,
+ pth_key_delete,
+ pth_key_setdata,
+ pth_key_getdata.
+ .Ip "\fBMessage Port Communication\fR" 4
+ pth_msgport_create,
+ pth_msgport_destroy,
+ pth_msgport_find,
+ pth_msgport_pending,
+ pth_msgport_put,
+ pth_msgport_get,
+ pth_msgport_reply.
+ .Ip "\fBThread Cleanups\fR" 4
+ pth_cleanup_push,
+ pth_cleanup_pop.
+ .Ip "\fBProcess Forking\fR" 4
+ pth_atfork_push,
+ pth_atfork_pop,
+ pth_fork.
+ .Ip "\fBSynchronization\fR" 4
+ pth_mutex_init,
+ pth_mutex_acquire,
+ pth_mutex_release,
+ pth_rwlock_init,
+ pth_rwlock_acquire,
+ pth_rwlock_release,
+ pth_cond_init,
+ pth_cond_await,
+ pth_cond_notify,
+ pth_barrier_init,
+ pth_barrier_reach.
+ .Ip "\fBGeneralized \s-1POSIX\s0 Replacement \s-1API\s0\fR" 4
+ pth_sigwait_ev,
+ pth_accept_ev,
+ pth_connect_ev,
+ pth_select_ev,
+ pth_poll_ev,
+ pth_read_ev,
+ pth_readv_ev,
+ pth_write_ev,
+ pth_writev_ev,
+ pth_recv_ev,
+ pth_recvfrom_ev,
+ pth_send_ev,
+ pth_sendto_ev.
+ .Ip "\fBStandard \s-1POSIX\s0 Replacement \s-1API\s0\fR" 4
+ pth_usleep,
+ pth_sleep,
+ pth_waitpid,
+ pth_sigmask,
+ pth_sigwait,
+ pth_accept,
+ pth_connect,
+ pth_select,
+ pth_poll,
+ pth_read,
+ pth_readv,
+ pth_write,
+ pth_writev,
+ pth_pread,
+ pth_pwrite,
+ pth_recv,
+ pth_recvfrom,
+ pth_send,
+ pth_sendto.
+ .SH "DESCRIPTION"
+ .PP
+ .Vb 5
+ \&  ____  _   _
+ \& |  _ \e| |_| |__
+ \& | |_) | __| '_ \e         ``Only those who attempt
+ \& |  __/| |_| | | |          the absurd can achieve
+ \& |_|    \e__|_| |_|          the impossible.''
+ .Ve
+ \fBPth\fR is a very portable POSIX/ANSI\-C based library for Unix platforms which
+ provides non-preemptive priority-based scheduling for multiple threads of
+ execution (aka `multithreading') inside event-driven applications. All threads
+ run in the same address space of the application process, but each thread has
+ its own individual program counter, run-time stack, signal mask and \f(CWerrno\fR
+ variable.
+ .PP
+ The thread scheduling itself is done in a cooperative way, i.e., the threads
+ are managed and dispatched by a priority- and event-driven non-preemptive
+ scheduler. The intention is that this way both better portability and run-time
+ performance is achieved than with preemptive scheduling. The event facility
+ allows threads to wait until various types of internal and external events
+ occur, including pending I/O on file descriptors, asynchronous signals,
+ elapsed timers, pending I/O on message ports, thread and process termination,
+ and even results of customized callback functions.
+ .PP
+ \fBPth\fR also provides an optional emulation API for POSIX.1c threads
+ (`Pthreads') which can be used for backward compatibility to existing
+ multithreaded applications. See \fBPth\fR's \fIpthread\fR\|(3) manual page for
+ details.
+ .Sh "Threading Background"
+ When programming event-driven applications, usually servers, lots of
+ regular jobs and one-shot requests have to be processed in parallel.
+ To efficiently simulate this parallel processing on uniprocessor
+ machines, we use `multitasking\*(R' -- that is, we have the application
+ ask the operating system to spawn multiple instances of itself. On
+ Unix, typically the kernel implements multitasking in a preemptive and
+ priority-based way through heavy-weight processes spawned with \fIfork\fR\|(2).
+ These processes usually do \fInot\fR share a common address space. Instead
+ they are clearly separated from each other, and are created by direct
+ cloning a process address space (although modern kernels use memory
+ segment mapping and copy-on-write semantics to avoid unnecessary copying
+ of physical memory).
+ .PP
+ The drawbacks are obvious: Sharing data between the processes is
+ complicated, and can usually only be done efficiently through shared
+ memory (but which itself is not very portable). Synchronization is
+ complicated because of the preemptive nature of the Unix scheduler
+ (one has to use \fIatomic\fR locks, etc). The machine's resources can be
+ exhausted very quickly when the server application has to serve too many
+ long-running requests (heavy-weight processes cost memory). And when
+ each request spawns a sub-process to handle it, the server performance
+ and responsiveness is horrible (heavy-weight processes cost time to
+ spawn). Finally, the server application doesn't scale very well with the
+ load because of these resource problems. In practice, lots of tricks
+ are usually used to overcome these problems \- ranging from pre-forked
+ sub-process pools to semi-serialized processing, etc.
+ .PP
+ One of the most elegant ways to solve these resource- and data-sharing
+ problems is to have multiple \fIlight-weight\fR threads of execution
+ inside a single (heavy-weight) process, i.e., to use \fImultithreading\fR.
+ Those \fIthreads\fR usually improve responsiveness and performance of the
+ application, often improve and simplify the internal program structure,
+ and most important, require less system resources than heavy-weight
+ processes. Threads are neither the optimal run-time facility for all
+ types of applications, nor can all applications benefit from them. But
+ at least event-driven server applications usually benefit greatly from
+ using threads.
+ .Sh "The World of Threading"
+ Even though lots of documents exists which describe and define the world
+ of threading, to understand \fBPth\fR, you need only basic knowledge about
+ threading. The following definitions of thread-related terms should at
+ least help you understand thread programming enough to allow you to use
+ \fBPth\fR.
+ .Ip "\fBo\fR \fBprocess\fR vs. \fBthread\fR" 2
+ A process on Unix systems consists of at least the following fundamental
+ ingredients: \fIvirtual memory table\fR, \fIprogram code\fR, \fIprogram
+ counter\fR, \fIheap memory\fR, \fIstack memory\fR, \fIstack pointer\fR, \fIfile
+ descriptor set\fR, \fIsignal table\fR. On every process switch, the kernel
+ saves and restores these ingredients for the individual processes. On
+ the other hand, a thread consists of only a private program counter,
+ stack memory, stack pointer and signal table. All other ingredients, in
+ particular the virtual memory, it shares with the other threads of the
+ same process.
+ .Ip "\fBo\fR \fBkernel-space\fR vs. \fBuser-space\fR threading" 2
+ Threads on a Unix platform traditionally can be implemented either
+ inside kernel-space or user-space. When threads are implemented by the
+ kernel, the thread context switches are performed by the kernel without
+ the application's knowledge. Similarly, when threads are implemented in
+ user-space, the thread context switches are performed by an application
+ library, without the kernel's knowledge. There also are hybrid threading
+ approaches where, typically, a user-space library binds one or more
+ user-space threads to one or more kernel-space threads (there usually
+ called light-weight processes \- or in short LWPs).
+ .Sp
+ User-space threads are usually more portable and can perform faster
+ and cheaper context switches (for instance via \fIswapcontext\fR\|(2) or
+ \fIsetjmp\fR\|(3)/\fIlongjmp\fR\|(3)) than kernel based threads. On the other hand,
+ kernel-space threads can take advantage of multiprocessor machines and
+ don't have any inherent I/O blocking problems. Kernel-space threads are
+ usually scheduled in preemptive way side-by-side with the underlying
+ processes. User-space threads on the other hand use either preemptive or
+ non-preemptive scheduling.
+ .Ip "\fBo\fR \fBpreemtive\fR vs. \fBnon-preemtive\fR thread scheduling" 2
+ In preemptive scheduling, the scheduler lets a thread execute until a
+ blocking situation occurs (usually a function call which would block)
+ or the assigned timeslice elapses. Then it detracts control from the
+ thread without a chance for the thread to object. This is usually
+ realized by interrupting the thread through a hardware interrupt
+ signal (for kernel-space threads) or a software interrupt signal (for
+ user-space threads), like \f(CWSIGALRM\fR or \f(CWSIGVTALRM\fR. In non-preemptive
+ scheduling, once a thread received control from the scheduler it keeps
+ it until either a blocking situation occurs (again a function call which
+ would block and instead switches back to the scheduler) or the thread
+ explicitly yields control back to the scheduler in a cooperative way.
+ .Ip "\fBo\fR \fBconcurrency\fR vs. \fBparallelism\fR" 2
+ Concurrency exists when at least two threads are \fIin progress\fR at the
+ same time. Parallelism arises when at least two threads are \fIexecuting\fR
+ simultaneously. Real parallelism can be only achieved on multiprocessor
+ machines, of course. But one also usually speaks of parallelism or
+ \fIhigh concurrency\fR in the context of preemptive thread scheduling
+ and of \fIlow concurrency\fR in the context of non-preemptive thread
+ scheduling.
+ .Ip "\fBo\fR \fBresponsiveness\fR" 2
+ The responsiveness of a system can be described by the user visible
+ delay until the system responses to an external request. When this delay
+ is small enough and the user doesn't recognize a noticeable delay,
+ the responsiveness of the system is considered good. When the user
+ recognizes or is even annoyed by the delay, the responsiveness of the
+ system is considered bad.
+ .Ip "\fBo\fR \fBreentrant\fR, \fBthread-safe\fR and \fBasynchronous-safe\fR functions" 2
+ A reentrant function is one that behaves correctly if it is called
+ simultaneously by several threads and then also executes simultaneously.
+ Functions that access global state, such as memory or files, of course,
+ need to be carefully designed in order to be reentrant. Two traditional
+ approaches to solve these problems are caller-supplied states and
+ thread-specific data.
+ .Sp
+ Thread-safety is the avoidance of \fIdata races\fR, i.e., situations
+ in which data is set to either correct or incorrect value depending
+ upon the (unpredictable) order in which multiple threads access and
+ modify the data. So a function is thread-safe when it still behaves
+ semantically correct when called simultaneously by several threads (it
+ is not required that the functions also execute simultaneously). The
+ traditional approach to achieve thread-safety is to wrap a function body
+ with an internal mutual exclusion lock (aka `mutex'). As you should
+ recognize, reentrant is a stronger attribute than thread-safe, because
+ it is harder to achieve and results especially in no run-time contention
+ between threads. So, a reentrant function is always thread-safe, but not
+ vice versa.
+ .Sp
+ Additionally there is a related attribute for functions named
+ asynchronous-safe, which comes into play in conjunction with signal
+ handlers. This is very related to the problem of reentrant functions. An
+ asynchronous-safe function is one that can be called safe and without
+ side-effects from within a signal handler context. Usually very few
+ functions are of this type, because an application is very restricted in
+ what it can perform from within a signal handler (especially what system
+ functions it is allowed to call). The reason mainly is, because only a
+ few system functions are officially declared by \s-1POSIX\s0 as guaranteed to
+ be asynchronous-safe. Asynchronous-safe functions usually have to be
+ already reentrant.
+ .Sh "User-Space Threads"
+ User-space threads can be implemented in various way. The two
+ traditional approaches are:
+ .Ip "\fB1.\fR" 3
+ \fBMatrix-based explicit dispatching between small units of execution:\fR
+ .Sp
+ Here the global procedures of the application are split into small
+ execution units (each is required to not run for more than a few
+ milliseconds) and those units are implemented by separate functions.
+ Then a global matrix is defined which describes the execution (and
+ perhaps even dependency) order of these functions. The main server
+ procedure then just dispatches between these units by calling one
+ function after each other controlled by this matrix. The threads are
+ created by more than one jump-trail through this matrix and by switching
+ between these jump-trails controlled by corresponding occurred events.
+ .Sp
+ This approach gives the best possible performance, because one can
+ fine-tune the threads of execution by adjusting the matrix, and the
+ scheduling is done explicitly by the application itself. It is also very
+ portable, because the matrix is just an ordinary data structure, and
+ functions are a standard feature of \s-1ANSI\s0 C.
+ .Sp
+ The disadvantage of this approach is that it is complicated to write
+ large applications with this approach, because in those applications
+ one quickly gets \fIhundreds\fR\|(!) of execution units and the control flow
+ inside such an application is very hard to understand (because it is
+ interrupted by function borders and one always has to remember the
+ global dispatching matrix to follow it). Additionally, all threads
+ operate on the same execution stack. Although this saves memory, it is
+ often nasty, because one cannot switch between threads in the middle of
+ a function. Thus the scheduling borders are the function borders.
+ .Ip "\fB2.\fR" 3
+ \fBContext-based implicit scheduling between threads of execution:\fR
+ .Sp
+ Here the idea is that one programs the application as with forked
+ processes, i.e., one spawns a thread of execution and this runs from the
+ begin to the end without an interrupted control flow. But the control
+ flow can be still interrupted \- even in the middle of a function.
+ Actually in a preemptive way, similar to what the kernel does for the
+ heavy-weight processes, i.e., every few milliseconds the user-space
+ scheduler switches between the threads of execution. But the thread
+ itself doesn't recognize this and usually (except for synchronization
+ issues) doesn't have to care about this.
+ .Sp
+ The advantage of this approach is that it's very easy to program,
+ because the control flow and context of a thread directly follows
+ a procedure without forced interrupts through function borders.
+ Additionally, the programming is very similar to a traditional and well
+ understood \fIfork\fR\|(2) based approach.
+ .Sp
+ The disadvantage is that although the general performance is increased,
+ compared to using approaches based on heavy-weight processes, it is decreased
+ compared to the matrix-approach above. Because the implicit preemptive
+ scheduling does usually a lot more context switches (every user-space context
+ switch costs some overhead even when it is a lot cheaper than a kernel-level
+ context switch) than the explicit cooperative/non-preemptive scheduling.
+ Finally, there is no really portable \s-1POSIX/ANSI\s0\-C based way to implement
+ user-space preemptive threading. Either the platform already has threads,
+ or one has to hope that some semi-portable package exists for it. And
+ even those semi-portable packages usually have to deal with assembler
+ code and other nasty internals and are not easy to port to forthcoming
+ platforms.
+ .PP
+ So, in short: the matrix-dispatching approach is portable and fast, but
+ nasty to program. The thread scheduling approach is easy to program,
+ but suffers from synchronization and portability problems caused by its
+ preemptive nature.
+ .Sh "The Compromise of Pth"
+ But why not combine the good aspects of both approaches while avoiding
+ their bad aspects? That's the goal of \fBPth\fR. \fBPth\fR implements
+ easy-to-program threads of execution, but avoids the problems of
+ preemptive scheduling by using non-preemptive scheduling instead.
+ .PP
+ This sounds like, and is, a useful approach. Nevertheless, one has to
+ keep the implications of non-preemptive thread scheduling in mind when
+ working with \fBPth\fR. The following list summarizes a few essential
+ points:
+ .Ip "\fBo\fR" 2
+ \fBPth provides maximum portability, but \s-1NOT\s0 the fanciest features\fR.
+ .Sp
+ This is, because it uses a nifty and portable \s-1POSIX/ANSI\s0\-C approach for
+ thread creation (and this way doesn't require any platform dependent
+ assembler hacks) and schedules the threads in non-preemptive way (which
+ doesn't require unportable facilities like \f(CWSIGVTALRM\fR). On the other
+ hand, this way not all fancy threading features can be implemented.
+ Nevertheless the available facilities are enough to provide a robust and
+ full-featured threading system.
+ .Ip "\fBo\fR" 2
+ \fBPth increases the responsiveness and concurrency of an event-driven
+ application, but \s-1NOT\s0 the concurrency of number-crunching applications\fR.
+ .Sp
+ The reason is the non-preemptive scheduling. Number-crunching
+ applications usually require preemptive scheduling to achieve
+ concurrency because of their long \s-1CPU\s0 bursts. For them, non-preemptive
+ scheduling (even together with explicit yielding) provides only the old
+ concept of `coroutines\*(R'. On the other hand, event driven applications
+ benefit greatly from non-preemptive scheduling. They have only short
+ \s-1CPU\s0 bursts and lots of events to wait on, and this way run faster under
+ non-preemptive scheduling because no unnecessary context switching
+ occurs, as it is the case for preemptive scheduling. That's why \fBPth\fR
+ is mainly intended for server type applications, although there is no
+ technical restriction.
+ .Ip "\fBo\fR" 2
+ \fBPth requires thread-safe functions, but \s-1NOT\s0 reentrant functions\fR.
+ .Sp
+ This nice fact exists again because of the nature of non-preemptive
+ scheduling, where a function isn't interrupted and this way cannot be
+ reentered before it returned. This is a great portability benefit,
+ because thread-safety can be achieved more easily than reentrance
+ possibility. Especially this means that under \fBPth\fR more existing
+ third-party libraries can be used without side-effects than its the case
+ for other threading systems.
+ .Ip "\fBo\fR" 2
+ \fBPth doesn't require any kernel support, but can \s-1NOT\s0
+ benefit from multiprocessor machines\fR.
+ .Sp
+ This means that \fBPth\fR runs on almost all Unix kernels, because the
+ kernel does not need to be aware of the \fBPth\fR threads (because they
+ are implemented entirely in user-space). On the other hand, it cannot
+ benefit from the existence of multiprocessors, because for this, kernel
+ support would be needed. In practice, this is no problem, because
+ multiprocessor systems are rare, and portability is almost more
+ important than highest concurrency.
+ .Sh "The life cycle of a thread"
+ To understand the \fBPth\fR Application Programming Interface (\s-1API\s0), it
+ helps to first understand the life cycle of a thread in the \fBPth\fR
+ threading system. It can be illustrated with the following directed
+ graph:
+ .PP
+ .Vb 10
+ \&             NEW
+ \&              |
+ \&              V
+ \&      +---> READY ---+
+ \&      |       ^      |
+ \&      |       |      V
+ \&   WAITING <--+-- RUNNING
+ \&                     |
+ \&      :              V
+ \&   SUSPENDED       DEAD
+ .Ve
+ When a new thread is created, it is moved into the \fB\s-1NEW\s0\fR queue of the
+ scheduler. On the next dispatching for this thread, the scheduler picks
+ it up from there and moves it to the \fB\s-1READY\s0\fR queue. This is a queue
+ containing all threads which want to perform a \s-1CPU\s0 burst. There they are
+ queued in priority order. On each dispatching step, the scheduler always
+ removes the thread with the highest priority only. It then increases the
+ priority of all remaining threads by 1, to prevent them from `starving\*(R'.
+ .PP
+ The thread which was removed from the \fB\s-1READY\s0\fR queue is the new
+ \fB\s-1RUNNING\s0\fR thread (there is always just one \fB\s-1RUNNING\s0\fR thread, of
+ course). The \fB\s-1RUNNING\s0\fR thread is assigned execution control. After
+ this thread yields execution (either explicitly by yielding excution
+ or implicitly by calling a function which would block) there are three
+ possibilities: Either it has terminated, then it is moved to the \fB\s-1DEAD\s0\fR
+ queue, or it has events on which it wants to wait, then it is moved into
+ the \fB\s-1WAITING\s0\fR queue. Else it is assumed it wants to perform more \s-1CPU\s0
+ bursts and immediately enters the \fB\s-1READY\s0\fR queue again.
+ .PP
+ Before the next thread is taken out of the \fB\s-1READY\s0\fR queue, the
+ \fB\s-1WAITING\s0\fR queue is checked for pending events. If one or more events
+ occurred, the threads that are waiting on them are immediately moved to
+ the \fB\s-1READY\s0\fR queue.
+ .PP
+ The purpose of the \fB\s-1NEW\s0\fR queue has to do with the fact that in \fBPth\fR
+ a thread never directly switches to another thread. A thread always
+ yields execution to the scheduler and the scheduler dispatches to the
+ next thread. So a freshly spawned thread has to be kept somewhere until
+ the scheduler gets a chance to pick it up for scheduling. That is for
+ what the \fB\s-1NEW\s0\fR queue is for. 
+ .PP
+ The purpose of the \fB\s-1DEAD\s0\fR queue is to support thread joining. When a
+ thread is marked to be unjoinable, it is directly kicked out of the
+ system after it terminated. But when it is joinable, it enters the
+ \fB\s-1DEAD\s0\fR queue. There it remains until another thread joins it.
+ .PP
+ Finally, there is a special separated queue named \fB\s-1SUSPENDED\s0\fR, to where
+ threads can be manually moved from the \fB\s-1NEW\s0\fR, \fB\s-1READY\s0\fR or \fB\s-1WAITING\s0\fR
+ queues by the application. The purpose of this special queue is to
+ temporarily absorb suspended threads until they are again resumed by
+ the application. Suspended threads do not cost scheduling or event
+ handling resources, because they are temporarily completely out of the
+ scheduler's scope. If a thread is resumed, it is moved back to the queue
+ from where it originally came and this way again enters the schedulers
+ scope.
+ .SH "APPLICATION PROGRAMMING INTERFACE (API)"
+ In the following the \fBPth\fR \fIApplication Programming Interface\fR (API)
+ is discussed in detail. With the knowledge given above, it should be
+ now easy to understand how to program threads with this API. In good
+ Unix tradition, \fBPth\fR functions use special return values (\f(CWNULL\fR
+ in pointer context, \f(CWFALSE\fR in boolean context and \f(CW-1\fR in integer
+ context) to indicate an error condition and set (or pass through) the
+ \f(CWerrno\fR system variable to pass more details about the error to the
+ caller.
+ .Sh "Global Library Management"
+ The following functions act on the library as a whole.  They are used to
+ initialize and shutdown the scheduler and fetch information from it.
+ .Ip "int \fBpth_init\fR(void);" 4
+ This initializes the \fBPth\fR library. It has to be the first \fBPth\fR \s-1API\s0
+ function call in an application, and is mandatory. It's usually done at
+ the begin of the \fImain()\fR function of the application. This implicitly
+ spawns the internal scheduler thread and transforms the single execution
+ unit of the current process into a thread (the `main\*(R' thread). It
+ returns \f(CWTRUE\fR on success and \f(CWFALSE\fR on error.
+ .Ip "int \fBpth_kill\fR(void);" 4
+ This kills the \fBPth\fR library. It should be the last \fBPth\fR \s-1API\s0 function call
+ in an application, but is not really required. It's usually done at the end of
+ the main function of the application. At least, it has to be called from within
+ the main thread. It implicitly kills all threads and transforms back the
+ calling thread into the single execution unit of the underlying process.  The
+ usual way to terminate a \fBPth\fR application is either a simple
+ `\f(CWpth_exit(0);\fR\*(R' in the main thread (which waits for all other threads to
+ terminate, kills the threading system and then terminates the process) or a
+ `\f(CWpth_kill(); exit(0)\fR\*(R' (which immediately kills the threading system and
+ terminates the process). The \fIpth_kill()\fR return immediately with a return
+ code of \f(CWFALSE\fR if it is called not from within the main thread. Else
+ kills the threading system and returns \f(CWTRUE\fR.
+ .Ip "long \fBpth_ctrl\fR(unsigned long \fIquery\fR, ...);" 4
+ This is a generalized query/control function for the \fBPth\fR library.  The
+ argument \fIquery\fR is a bitmask formed out of one or more \f(CWPTH_CTRL_\fR\fI\s-1XXXX\s0\fR
+ queries. Currently the following queries are supported:
+ .Ip "\f(CWPTH_CTRL_GETTHREADS\fR" 8
+ This returns the total number of threads currently in existence.  This query
+ actually is formed out of the combination of queries for threads in a
+ particular state, i.e., the \f(CWPTH_CTRL_GETTHREADS\fR query is equal to the
+ \s-1OR\s0\-combination of all the following specialized queries:
+ .Sp
+ \f(CWPTH_CTRL_GETTHREADS_NEW\fR for the number of threads in the
+ new queue (threads created via \fIpth_spawn\fR\|(3) but still not
+ scheduled once), \f(CWPTH_CTRL_GETTHREADS_READY\fR for the number of
+ threads in the ready queue (threads who want to do \s-1CPU\s0 bursts),
+ \f(CWPTH_CTRL_GETTHREADS_RUNNING\fR for the number of running threads
+ (always just one thread!), \f(CWPTH_CTRL_GETTHREADS_WAITING\fR for
+ the number of threads in the waiting queue (threads waiting for
+ events), \f(CWPTH_CTRL_GETTHREADS_SUSPENDED\fR for the number of
+ threads in the suspended queue (threads waiting to be resumed) and
+ \f(CWPTH_CTRL_GETTHREADS_DEAD\fR for the number of threads in the new queue
+ (terminated threads waiting for a join).
+ .Ip "\f(CWPTH_CTRL_GETAVLOAD\fR" 8
+ This requires a second argument of type `\f(CWfloat *\fR\*(R' (pointer to a floating
+ point variable).  It stores a floating point value describing the exponential
+ averaged load of the scheduler in this variable. The load is a function from
+ the number of threads in the ready queue of the schedulers dispatching unit.
+ So a load around 1.0 means there is only one ready thread (the standard
+ situation when the application has no high load). A higher load value means
+ there a more threads ready who want to do \s-1CPU\s0 bursts. The average load value
+ updates once per second only. The return value for this query is always 0.
+ .Ip "\f(CWPTH_CTRL_GETPRIO\fR" 8
+ This requires a second argument of type `\f(CWpth_t\fR\*(R' which identifies a
+ thread.  It returns the priority (ranging from \f(CWPTH_PRIO_MIN\fR to
+ \f(CWPTH_PRIO_MAX\fR) of the given thread.
+ .Ip "\f(CWPTH_CTRL_GETNAME\fR" 8
+ This requires a second argument of type `\f(CWpth_t\fR\*(R' which identifies a
+ thread. It returns the name of the given thread, i.e., the return value of
+ \fIpth_ctrl\fR\|(3) should be casted to a `\f(CWchar *\fR\*(R'.
+ .Ip "\f(CWPTH_CTRL_DUMPSTATE\fR" 8
+ This requires a second argument of type `\f(CWFILE *\fR\*(R' to which a summary
+ of the internal \fBPth\fR library state is written to. The main information
+ which is currently written out is the current state of the thread pool.
+ .Sp
+ The function returns \f(CW-1\fR on error.
+ .Ip "long \fBpth_version\fR(void);" 4
+ This function returns a hex-value `0x\fIV\fR\fI\s-1RR\s0\fR\fIT\fR\fI\s-1LL\s0\fR\*(R' which describes the
+ current \fBPth\fR library version. \fIV\fR is the version, \fI\s-1RR\s0\fR the revisions,
+ \fI\s-1LL\s0\fR the level and \fIT\fR the type of the level (alphalevel=0, betalevel=1,
+ patchlevel=2, etc). For instance \fBPth\fR version 1.0b1 is encoded as 0x100101.
+ The reason for this unusual mapping is that this way the version number is
+ steadily \fIincreasing\fR. The same value is also available under compile time as
+ \f(CWPTH_VERSION\fR.
+ .Sh "Thread Attribute Handling"
+ Attribute objects are used in \fBPth\fR for two things: First stand-alone/unbound
+ attribute objects are used to store attributes for to be spawned threads.
+ Bounded attribute objects are used to modify attributes of already existing
+ threads. The following attribute fields exists in attribute objects:
+ .Ip "\f(CWPTH_ATTR_PRIO\fR (read-write) [\f(CWint\fR]" 4
+ Thread Priority between \f(CWPTH_PRIO_MIN\fR and \f(CWPTH_PRIO_MAX\fR.
+ The default is \f(CWPTH_PRIO_STD\fR.
+ .Ip "\f(CWPTH_ATTR_NAME\fR (read-write) [\f(CWchar *\fR]" 4
+ Name of thread (up to 40 characters are stored only), mainly for debugging
+ purposes.
+ .Ip "\f(CWPTH_ATTR_JOINABLE\fR (read-write> [\f(CWint\fR]" 4
+ The thread detachment type, \f(CWTRUE\fR indicates a joinable thread, \f(CWFALSE\fR
+ indicates a detached thread.  When a the is detached after termination it is
+ immediately kicked out of the system instead of inserted into the dead queue.
+ .Ip "\f(CWPTH_ATTR_CANCEL_STATE\fR (read-write) [\f(CWunsigned int\fR]" 4
+ The thread cancellation state, i.e., a combination of \f(CWPTH_CANCEL_ENABLE\fR or
+ \f(CWPTH_CANCEL_DISABLE\fR and \f(CWPTH_CANCEL_DEFERRED\fR or
+ \f(CWPTH_CANCEL_ASYNCHRONOUS\fR.
+ .Ip "\f(CWPTH_ATTR_STACK_SIZE\fR (read-write) [\f(CWunsigned int\fR]" 4
+ The thread stack size in bytes. Use lower values than 64 \s-1KB\s0 with great care!
+ .Ip "\f(CWPTH_ATTR_STACK_ADDR\fR (read-write) [\f(CWchar *\fR]" 4
+ A pointer to the lower address of a chunk of \fImalloc\fR\|(3)'ed memory for the
+ stack.
+ .Ip "\f(CWPTH_ATTR_TIME_SPAWN\fR (read-only) [\f(CWpth_time_t\fR]" 4
+ The time when the thread was spawned.
+ This can be queried only when the attribute object is bound to a thread.
+ .Ip "\f(CWPTH_ATTR_TIME_LAST\fR (read-only) [\f(CWpth_time_t\fR]" 4
+ The time when the thread was last dispatched.
+ This can be queried only when the attribute object is bound to a thread.
+ .Ip "\f(CWPTH_ATTR_TIME_RAN\fR (read-only) [\f(CWpth_time_t\fR]" 4
+ The total time the thread was running.
+ This can be queried only when the attribute object is bound to a thread.
+ .Ip "\f(CWPTH_ATTR_START_FUNC\fR (read-only) [\f(CWvoid *(*)(void *)\fR]" 4
+ The thread start function.
+ This can be queried only when the attribute object is bound to a thread.
+ .Ip "\f(CWPTH_ATTR_START_ARG\fR (read-only) [\f(CWvoid *\fR]" 4
+ The thread start argument.
+ This can be queried only when the attribute object is bound to a thread.
+ .Ip "\f(CWPTH_ATTR_STATE\fR (read-only) [\f(CWpth_state_t\fR]" 4
+ The scheduling state of the thread, i.e., either \f(CWPTH_STATE_NEW\fR,
+ \f(CWPTH_STATE_READY\fR, \f(CWPTH_STATE_WAITING\fR, or \f(CWPTH_STATE_DEAD\fR
+ This can be queried only when the attribute object is bound to a thread.
+ .Ip "\f(CWPTH_ATTR_EVENTS\fR (read-only) [\f(CWpth_event_t\fR]" 4
+ The event ring the thread is waiting for.
+ This can be queried only when the attribute object is bound to a thread.
+ .Ip "\f(CWPTH_ATTR_BOUND\fR (read-only) [\f(CWint\fR]" 4
+ Whether the attribute object is bound (\f(CWTRUE\fR) to a thread or not (\f(CWFALSE\fR).
+ .PP
+ The following \s-1API\s0 functions exists to handle the attribute objects:
+ .Ip "pth_attr_t \fBpth_attr_of\fR(pth_t \fItid\fR);" 4
+ This returns a new attribute object \fIbound\fR to thread \fItid\fR.  Any queries on
+ this object directly fetch attributes from \fItid\fR. And attribute modifications
+ directly change \fItid\fR. Use such attribute objects to modify existing threads.
+ .Ip "pth_attr_t \fBpth_attr_new\fR(void);" 4
+ This returns a new \fIunbound\fR attribute object. An implicit \fIpth_attr_init()\fR is
+ done on it. Any queries on this object just fetch stored attributes from it.
+ And attribute modifications just change the stored attributes.  Use such
+ attribute objects to pre-configure attributes for to be spawned threads.
+ .Ip "int \fBpth_attr_init\fR(pth_attr_t \fIattr\fR);" 4
+ This initializes an attribute object \fIattr\fR to the default values:
+ \f(CWPTH_ATTR_PRIO\fR := \f(CWPTH_PRIO_STD\fR, \f(CWPTH_ATTR_NAME\fR := `\f(CWunknown\fR\*(R',
+ \f(CWPTH_ATTR_JOINABLE\fR := \f(CWTRUE\fR, \f(CWPTH_ATTR_CANCELSTATE\fR :=
+ \f(CWPTH_CANCEL_DEFAULT\fR, \f(CWPTH_ATTR_STACK_SIZE\fR := 64*1024 and
+ \f(CWPTH_ATTR_STACK_ADDR\fR := \f(CWNULL\fR. All other \f(CWPTH_ATTR_*\fR attributes are
+ read-only attributes and don't receive default values in \fIattr\fR, because they
+ exists only for bounded attribute objects.
+ .Ip "int \fBpth_attr_set\fR(pth_attr_t \fIattr\fR, int \fIfield\fR, ...);" 4
+ This sets the attribute field \fIfield\fR in \fIattr\fR to a value
+ specified as an additional argument on the variable argument
+ list. The following attribute \fIfields\fR and argument pairs can
+ be used: 
+ .Sp
+ .Vb 6
+ \& PTH_ATTR_PRIO           int
+ \& PTH_ATTR_NAME           char *
+ \& PTH_ATTR_JOINABLE       int
+ \& PTH_ATTR_CANCEL_STATE   unsigned int
+ \& PTH_ATTR_STACK_SIZE     unsigned int 
+ \& PTH_ATTR_STACK_ADDR     char *
+ .Ve
+ .Ip "int \fBpth_attr_get\fR(pth_attr_t \fIattr\fR, int \fIfield\fR, ...);" 4
+ This retrieves the attribute field \fIfield\fR in \fIattr\fR and stores its
+ value in the variable specified through a pointer in an additional
+ argument on the variable argument list. The following \fIfields\fR and
+ argument pairs can be used:
+ .Sp
+ .Vb 14
+ \& PTH_ATTR_PRIO           int *
+ \& PTH_ATTR_NAME           char **
+ \& PTH_ATTR_JOINABLE       int *
+ \& PTH_ATTR_CANCEL_STATE   unsigned int *
+ \& PTH_ATTR_STACK_SIZE     unsigned int *
+ \& PTH_ATTR_STACK_ADDR     char **
+ \& PTH_ATTR_TIME_SPAWN     pth_time_t *
+ \& PTH_ATTR_TIME_LAST      pth_time_t *
+ \& PTH_ATTR_TIME_RAN       pth_time_t *
+ \& PTH_ATTR_START_FUNC     void *(**)(void *)
+ \& PTH_ATTR_START_ARG      void **
+ \& PTH_ATTR_STATE          pth_state_t *
+ \& PTH_ATTR_EVENTS         pth_event_t *
+ \& PTH_ATTR_BOUND          int *
+ .Ve
+ .Ip "int \fBpth_attr_destroy\fR(pth_attr_t \fIattr\fR);" 4
+ This destroys a attribute object \fIattr\fR. After this \fIattr\fR is no
+ longer a valid attribute object.
+ .Sh "Thread Control"
+ The following functions control the threading itself and form the main \s-1API\s0 of
+ the \fBPth\fR library.
+ .Ip "pth_t \fBpth_spawn\fR(pth_attr_t \fIattr\fR, void *(*\fIentry\fR)(void *), void *\fIarg\fR);" 4
+ This spawns a new thread with the attributes given in \fIattr\fR (or
+ \f(CWPTH_ATTR_DEFAULT\fR for default attributes \- which means that thread priority,
+ joinability and cancel state are inherited from the current thread) with the
+ starting point at routine \fIentry\fR. This entry routine is called as
+ `\fIpth_exit\fR\|(\fIentry\fR(\fIarg\fR))\*(R' inside the new thread unit, i.e., \fIentry\fR's
+ return value is fed to an implicit \fIpth_exit\fR\|(3). So the thread usually can exit
+ by just returning. Nevertheless the thread can also exit explicitly at any
+ time by calling \fIpth_exit\fR\|(3). But keep in mind that calling the \s-1POSIX\s0 function
+ \fIexit\fR\|(3) still terminates the complete process and not just the current thread.
+ .Sp
+ There is no \fBPth\fR\-internal limit on the number of threads one can spawn,
+ except the limit implied by the available virtual memory. \fBPth\fR internally
+ keeps track of thread in dynamic data structures. The function returns
+ \f(CWNULL\fR on error.
+ .Ip "int \fBpth_once\fR(pth_once_t *\fIctrlvar\fR, void (*\fIfunc\fR)(void *), void *\fIarg\fR);" 4
+ This is a convenience function which uses a control variable of type
+ \f(CWpth_once_t\fR to make sure a constructor function \fIfunc\fR is called only once
+ as `\fIfunc\fR(\fIarg\fR)\*(R' in the system. In other words: Only the first call to
+ \fIpth_once\fR\|(3) by any thread in the system succeeds. The variable referenced via
+ \fIctrlvar\fR should be declared as `\f(CWpth_once_t\fR \fIvariable-name\fR =
+ \f(CWPTH_ONCE_INIT\fR;\*(R' before calling this function.
+ .Ip "pth_t \fBpth_self\fR(void);" 4
+ This just returns the unique thread handle of the currently running thread.
+ This handle itself has to be treated as an opaque entity by the application.
+ It's usually used as an argument to other functions who require an argument of
+ type \f(CWpth_t\fR.
+ .Ip "int \fBpth_suspend\fR(pth_t \fItid\fR);" 4
+ This suspends a thread \fItid\fR until it is manually resumed again via
+ \fIpth_resume\fR\|(3). For this, the thread is moved to the \fB\s-1SUSPENDED\s0\fR queue
+ and this way is completely out of the scheduler's event handling and
+ thread dispatching scope. Suspending the current thread is not allowed.
+ The function returns \f(CWTRUE\fR on success and \f(CWFALSE\fR on errors.
+ .Ip "int \fBpth_resume\fR(pth_t \fItid\fR);" 4
+ This function resumes a previously suspended thread \fItid\fR, i.e. \fItid\fR
+ has to stay on the \fB\s-1SUSPENDED\s0\fR queue. The thread is moved to the
+ \fB\s-1NEW\s0\fR, \fB\s-1READY\s0\fR or \fB\s-1WAITING\s0\fR queue (dependent on what its state was
+ when the \fIpth_suspend\fR\|(3) call were made) and this way again enters the
+ event handling and thread dispatching scope of the scheduler. The
+ function returns \f(CWTRUE\fR on success and \f(CWFALSE\fR on errors.
+ .Ip "int \fBpth_raise\fR(pth_t \fItid\fR, int \fIsig\fR)" 4
+ This function raises a signal for delivery to thread \fItid\fR only.  When one
+ just raises a signal via \fIraise\fR\|(3) or \fIkill\fR\|(2), its delivered to an arbitrary
+ thread which has this signal not blocked.  With \fIpth_raise\fR\|(3) one can send a
+ signal to a thread and its guarantees that only this thread gets the signal
+ delivered. But keep in mind that nevertheless the signals \fIaction\fR is still
+ configured \fIprocess\fR\-wide.  When \fIsig\fR is 0 plain thread checking is
+ performed, i.e., `\f(CWpth_raise(tid, 0)\fR\*(R' returns \f(CWTRUE\fR when thread \fItid\fR
+ still exists in the \fB\s-1PTH\s0\fR system but doesn't send any signal to it.
+ .Ip "int \fBpth_yield\fR(pth_t \fItid\fR);" 4
+ This explicitly yields back the execution control to the scheduler thread.
+ Usually the execution is implicitly transferred back to the scheduler when a
+ thread waits for an event. But when a thread has to do larger \s-1CPU\s0 bursts, it
+ can be reasonable to interrupt it explicitly by doing a few \fIpth_yield\fR\|(3) calls
+ to give other threads a chance to execute, too.  This obviously is the
+ cooperating part of \fBPth\fR.  A thread \fIhas not\fR to yield execution, of
+ course. But when you want to program a server application with good response
+ times the threads should be cooperative, i.e., when they should split their \s-1CPU\s0
+ bursts into smaller units with this call.
+ .Sp
+ Usually one specifies \fItid\fR as \f(CWNULL\fR to indicate to the scheduler that it
+ can freely decide which thread to dispatch next.  But if one wants to indicate
+ to the scheduler that a particular thread should be favored on the next
+ dispatching step, one can specify this thread explicitly. This allows the
+ usage of the old concept of \fIcoroutines\fR where a thread/routine switches to a
+ particular cooperating thread. If \fItid\fR is not \f(CWNULL\fR and points to a \fInew\fR
+ or \fIready\fR thread, it is guaranteed that this thread receives execution
+ control on the next dispatching step. If \fItid\fR is in a different state (that
+ is, not in \f(CWPTH_STATE_NEW\fR or \f(CWPTH_STATE_READY\fR) an error is reported.
+ .Sp
+ The function usually returns \f(CWTRUE\fR for success and only \f(CWFALSE\fR (with
+ \f(CWerrno\fR set to \f(CWEINVAL\fR) if \fItid\fR specified and invalid or still not
+ new or ready thread.
+ .Ip "int \fBpth_nap\fR(pth_time_t \fInaptime\fR);" 4
+ This functions suspends the execution of the current thread until \fInaptime\fR
+ is elapsed. \fInaptime\fR is of type \f(CWpth_time_t\fR and this way has theoretically
+ a resolution of one microsecond. In practice you should neither rely on this
+ nor that the thread is awakened exactly after \fInaptime\fR has elapsed. It's
+ only guarantees that the thread will sleep at least \fInaptime\fR. But because
+ of the non-preemptive nature of \fBPth\fR it can last longer (when another thread
+ kept the \s-1CPU\s0 for a long time). Additionally the resolution is dependent of the
+ implementation of timers by the operating system and these usually have only a
+ resolution of 10 microseconds or larger. But usually this isn't important for
+ an application unless it tries to use this facility for real time tasks.
+ .Ip "int \fBpth_wait\fR(pth_event_t \fIev\fR);" 4
+ This is the link between the scheduler and the event facility (see below for
+ the various \fIpth_event_xxx()\fR functions). It's modeled like \fIselect\fR\|(2), i.e., one
+ gives this function one or more events (in the event ring specified by \fIev\fR)
+ on which the current thread wants to wait.  The scheduler awakes the thread
+ when one ore more of them occurred after tagging them as occurred. The \fIev\fR
+ argument is a \fIpointer\fR to an event ring which isn't changed except for the
+ tagging. \fIpth_wait\fR\|(3) returns the number of occurred events and the application
+ can use \fIpth_event_occurred\fR\|(3) to test which events occurred.
+ .Ip "int \fBpth_cancel\fR(pth_t \fItid\fR);" 4
+ This cancels a thread \fItid\fR. How the cancellation is done depends on the
+ cancellation state of \fItid\fR which the thread can configure itself. When its
+ state is \f(CWPTH_CANCEL_DISABLE\fR a cancellation request is just made pending.
+ When it is \f(CWPTH_CANCEL_ENABLE\fR it depends on the cancellation type what is
+ performed. When its \f(CWPTH_CANCEL_DEFERRED\fR again the cancellation request is
+ just made pending. But when its \f(CWPTH_CANCEL_ASYNCHRONOUS\fR the thread is
+ immediately canceled before \fIpth_cancel\fR\|(3) returns. The effect of a thread
+ cancellation is equal to implicitly forcing the thread to call
+ `\f(CWpth_exit(PTH_CANCELED)\fR\*(R' at one of his cancellation points.  In \fBPth\fR
+ thread enter a cancellation point either explicitly via \fIpth_cancel_point\fR\|(3) or
+ implicitly by waiting for an event.
+ .Ip "int \fBpth_abort\fR(pth_t \fItid\fR);" 4
+ This is the cruel way to cancel a thread \fItid\fR. When it's already dead and
+ waits to be joined it just joins it (via `\f(CWpth_join(\fR\fItid\fR\f(CW, NULL)\fR') and
+ this way kicks it out of the system.  Else it forces the thread to be not
+ joinable and to allow asynchronous cancellation and then cancels it via
+ `\f(CWpth_cancel(\fR\fItid\fR\f(CW)\fR\*(R'.
+ .Ip "int \fBpth_join\fR(pth_t \fItid\fR, void **\fIvalue\fR);" 4
+ This joins the current thread with the thread specified via \fItid\fR.  It first
+ suspends the current thread until the \fItid\fR thread has terminated. Then it is
+ awakened and stores the value of \fItid\fR's \fIpth_exit\fR\|(3) call into *\fIvalue\fR (if
+ \fIvalue\fR and not \f(CWNULL\fR) and returns to the caller.  A thread can be joined
+ only when it was \fInot\fR spawned with \f(CWPTH_FLAG_NOJOIN\fR. A thread can only be
+ joined once, i.e., after the \fIpth_join\fR\|(3) call the thread \fItid\fR is removed
+ from the system.
+ .Ip "void \fBpth_exit\fR(void *\fIvalue\fR);" 4
+ This terminates the current thread. Whether it's immediately removed from the
+ system or inserted into the dead queue of the scheduler depends on its join
+ type which was specified at spawning time. When it was spawned with
+ \f(CWPTH_FLAG_NOJOIN\fR it's immediately removed and \fIvalue\fR is ignored.
+ Else the thread is inserted into the dead queue and \fIvalue\fR remembered
+ for a \fIpth_join\fR\|(3) call by another thread.
+ .Sh "Utilities"
+ The following functions are utility functions.
+ .Ip "int \fBpth_fdmode\fR(int \fIfd\fR, int \fImode\fR);" 4
+ This switches the non-blocking mode flag on file descriptor \fIfd\fR.  The
+ argument \fImode\fR can be \f(CWPTH_FDMODE_BLOCK\fR for switching \fIfd\fR into blocking
+ I/O mode, \f(CWPTH_FDMODE_NONBLOCK\fR for switching \fIfd\fR into non-blocking I/O
+ mode or \f(CWPTH_FDMODE_POLL\fR for just polling the current mode. The current mode
+ is returned (either \f(CWPTH_FDMODE_BLOCK\fR or \f(CWPTH_FDMODE_NONBLOCK\fR) or
+ \f(CWPTH_FDMODE_ERROR\fR on error. Keep in mind that since \fBPth\fR 1.1 there is no
+ longer a requirement to manually switch a file descriptor into non-blocking
+ mode in order to use it. This is automatically done temporarily inside \fBPth\fR.
+ Instead when you now switch a file descriptor explicitly into non-blocking
+ mode, \fIpth_read\fR\|(3) or \fIpth_write\fR\|(3) will never block the current thread.
+ .Ip "pth_time_t \fBpth_time\fR(long \fIsec\fR, long \fIusec\fR);" 4
+ This is a constructor for a \f(CWpth_time_t\fR structure which is a convenient
+ function to avoid temporary structure values. It returns a \fIpth_time_t\fR
+ structure which holds the absolute time value specified by \fIsec\fR and \fIusec\fR.
+ .Ip "pth_time_t \fBpth_timeout\fR(long \fIsec\fR, long \fIusec\fR);" 4
+ This is a constructor for a \f(CWpth_time_t\fR structure which is a convenient
+ function to avoid temporary structure values.  It returns a \fIpth_time_t\fR
+ structure which holds the absolute time value calculated by adding \fIsec\fR and
+ \fIusec\fR to the current time.
+ .Ip "Sfdisc_t *\fBpth_sfiodisc\fR(void);" 4
+ This functions is always available, but only reasonably usable when \fBPth\fR
+ was built with \fBSfio\fR support (\f(CW--with-sfio\fR option) and \f(CWPTH_EXT_SFIO\fR is
+ then defined by \f(CWpth.h\fR. It is useful for applications which want to use the
+ comprehensive \fBSfio\fR I/O library with the \fBPth\fR threading library. Then this
+ function can be used to get an \fBSfio\fR discipline structure (\f(CWSfdisc_t\fR)
+ which can be pushed onto \fBSfio\fR streams (\f(CWSfio_t\fR) in order to let this
+ stream use \fIpth_read\fR\|(3)/\fIpth_write\fR\|(2) instead of \fIread\fR\|(2)/\fIwrite\fR\|(2). The benefit
+ is that this way I/O on the \fBSfio\fR stream does only block the current thread
+ instead of the whole process. The application has to \fIfree\fR\|(3) the \f(CWSfdisc_t\fR
+ structure when it is no longer needed. The Sfio package can be found at
+ http://www.research.att.com/sw/tools/sfio/.
+ .Sh "Cancellation Management"
+ \fBPth\fR supports \s-1POSIX\s0 style thread cancellation via \fIpth_cancel\fR\|(3) and the
+ following two related functions:
+ .Ip "void \fBpth_cancel_state\fR(int \fInewstate\fR, int *\fIoldstate\fR);" 4
+ This manages the cancellation state of the current thread.  When \fIoldstate\fR
+ is not \f(CWNULL\fR the function stores the old cancellation state under the
+ variable pointed to by \fIoldstate\fR. When \fInewstate\fR is not \f(CW0\fR it sets the
+ new cancellation state. \fIoldstate\fR is created before \fInewstate\fR is set.  A
+ state is a combination of \f(CWPTH_CANCEL_ENABLE\fR or \f(CWPTH_CANCEL_DISABLE\fR and
+ \f(CWPTH_CANCEL_DEFERRED\fR or \f(CWPTH_CANCEL_ASYNCHRONOUS\fR.
+ \f(CWPTH_CANCEL_ENABLE|PTH_CANCEL_DEFERRED\fR (or \f(CWPTH_CANCEL_DEFAULT\fR) is the
+ default state where cancellation is possible but only at cancellation points.
+ Use \f(CWPTH_CANCEL_DISABLE\fR to complete disable cancellation for a thread and
+ \f(CWPTH_CANCEL_ASYNCHRONOUS\fR for allowing asynchronous cancellations, i.e.,
+ cancellations which can happen at any time.
+ .Ip "void \fBpth_cancel_point\fR(void);" 4
+ This explicitly enter a cancellation point. When the current cancellation
+ state is \f(CWPTH_CANCEL_DISABLE\fR or no cancellation request is pending, this has
+ no side-effect and returns immediately. Else it calls
+ `\f(CWpth_exit(PTH_CANCELED)\fR\*(R'.
+ .Sh "Event Handling"
+ \fBPth\fR has a very flexible event facility which is linked into the scheduler
+ through the \fIpth_wait\fR\|(3) function. The following functions provide the handling
+ of event rings.
+ .Ip "pth_event_t \fBpth_event\fR(unsigned long \fIspec\fR, ...);" 4
+ This creates a new event ring consisting of a single initial event.  The type
+ of the generated event is specified by \fIspec\fR. The following types are
+ available:
+ .Ip "\f(CWPTH_EVENT_FD\fR" 8
+ This is a file descriptor event. One or more of \f(CWPTH_UNTIL_FD_READABLE\fR,
+ \f(CWPTH_UNTIL_FD_WRITEABLE\fR or \f(CWPTH_UNTIL_FD_EXECPTION\fR have to be \s-1OR\s0\-ed into
+ \fIspec\fR to specify on which state of the file descriptor you want to wait.  The
+ file descriptor itself has to be given as an additional argument.  Example:
+ `\f(CWpth_event(PTH_EVENT_FD|PTH_UNTIL_FD_READABLE, fd)\fR\*(R'.
+ .Ip "\f(CWPTH_EVENT_SELECT\fR" 8
+ This is a multiple file descriptor event modeled directly after the \fIselect\fR\|(2)
+ call (actually it is also used to implement \fIpth_select\fR\|(3) internally).  It's a
+ convenient way to wait for a large set of file descriptors at once and at each
+ file descriptor for a different type of state. Additionally as a nice
+ side-effect one receives the number of file descriptors which causes the event
+ to be occurred (using \s-1BSD\s0 semantics, i.e., when a file descriptor occurred in
+ two sets it's counted twice). The arguments correspond directly to the
+ \fIselect\fR\|(2) function arguments except that there is no timeout argument (because
+ timeouts already can be handled via \f(CWPTH_EVENT_TIME\fR events).
+ .Sp
+ Example: `\f(CWpth_event(PTH_EVENT_SELECT, &rc, nfd, rfds, wfds, efds)\fR\*(R' where
+ \f(CWrc\fR has to be of type `\f(CWint *\fR\*(R', \f(CWnfd\fR has to be of type `\f(CWint\fR\*(R' and
+ \f(CWrfds\fR, \f(CWwfds\fR and \f(CWefds\fR have to be of type `\f(CWfd_set *\fR\*(R' (see
+ \fIselect\fR\|(2)). The number of occurred file descriptors are stored in \f(CWrc\fR.
+ .Ip "\f(CWPTH_EVENT_SIGS\fR" 8
+ This is a signal set event. The two additional arguments have to be a pointer
+ to a signal set (type `\f(CWsigset_t *\fR') and a pointer to a signal number
+ variable (type `\f(CWint *\fR').  This event waits until one of the signals in
+ the signal set occurred.  As a result the occurred signal number is stored in
+ the second additional argument. Keep in mind that the \fBPth\fR scheduler doesn't
+ block signals automatically.  So when you want to wait for a signal with this
+ event you've to block it via \fIsigprocmask\fR\|(2) or it will be delivered without
+ your notice. Example: `\f(CWsigemptyset(&set); sigaddset(&set, SIGINT);
+ pth_event(PTH_EVENT_SIG, &set, &sig);\fR\*(R'.
+ .Ip "\f(CWPTH_EVENT_TIME\fR" 8
+ This is a time point event. The additional argument has to be of type
+ \f(CWpth_time_t\fR (usually on-the-fly generated via \fIpth_time\fR\|(3)). This events
+ waits until the specified time point has elapsed. Keep in mind that the value
+ is an absolute time point and not an offset. When you want to wait for a
+ specified amount of time, you've to add the current time to the offset
+ (usually on-the-fly achieved via \fIpth_timeout\fR\|(3)).  Example:
+ `\f(CWpth_event(PTH_EVENT_TIME, pth_timeout(2,0))\fR\*(R'.
+ .Ip "\f(CWPTH_EVENT_MSG\fR" 8
+ This is a message port event. The additional argument has to be of type
+ \f(CWpth_msgport_t\fR. This events waits until one or more messages were received
+ on the specified message port.  Example: `\f(CWpth_event(PTH_EVENT_MSG, mp)\fR\*(R'.
+ .Ip "\f(CWPTH_EVENT_TID\fR" 8
+ This is a thread event. The additional argument has to be of type \f(CWpth_t\fR.
+ One of \f(CWPTH_UNTIL_TID_NEW\fR, \f(CWPTH_UNTIL_TID_READY\fR, \f(CWPTH_UNTIL_TID_WAITING\fR
+ or \f(CWPTH_UNTIL_TID_DEAD\fR has to be \s-1OR\s0\-ed into \fIspec\fR to specify on which
+ state of the thread you want to wait.  Example:
+ `\f(CWpth_event(PTH_EVENT_TID|PTH_UNTIL_TID_DEAD, tid)\fR\*(R'.
+ .Ip "\f(CWPTH_EVENT_FUNC\fR" 8
+ This is a custom callback function event. Three additional arguments
+ have to be given with the following types: `\f(CWint (*)(void *)\fR\*(R',
+ `\f(CWvoid *\fR\*(R' and `\f(CWpth_time_t\fR\*(R'. The first is a function pointer to
+ a check function and the second argument is a user-supplied context
+ value which is passed to this function. The scheduler calls this
+ function on a regular basis (on his own scheduler stack, so be very
+ careful!) and the thread is kept sleeping while the function returns
+ \f(CWFALSE\fR. Once it returned \f(CWTRUE\fR the thread will be awakend. The
+ check interval is defined by the third argument, i.e., the check
+ function is polled again not until this amount of time elapsed. Example:
+ `\f(CWpth_event(PTH_EVENT_FUNC, func, arg, pth_time(0,500000))\fR\*(R'.
+ .Ip "unsigned long \fBpth_event_typeof\fR(pth_event_t \fIev\fR);" 4
+ This returns the type of event \fIev\fR. It's a combination of the describing
+ \f(CWPTH_EVENT_XX\fR and \f(CWPTH_UNTIL_XX\fR value. This is especially useful to know
+ which arguments have to be supplied to the \fIpth_event_extract\fR\|(3) function.
+ .Ip "int \fBpth_event_extract\fR(pth_event_t \fIev\fR, ...);" 4
+ When \fIpth_event\fR\|(3) is treated like \fIsprintf\fR\|(3), then this function is
+ \fIsscanf\fR\|(3), i.e., it is the inverse operation of \fIpth_event\fR\|(3). This means that
+ it can be used to extract the ingredients of an event.  The ingredients are
+ stored into variables which are given as pointers on the variable argument
+ list.  Which pointers have to be present depends on the event type and has to
+ be determined by the caller before via \fIpth_event_typeof\fR\|(3).
+ .Sp
+ To make it clear, when you constructed \fIev\fR via `\f(CWev =
+ pth_event(PTH_EVENT_FD, fd);\fR\*(R' you have to extract it via
+ `\f(CWpth_event_extract(ev, &fd)\fR\*(R', etc. For multiple arguments of an event the
+ order of the pointer arguments is the same as for \fIpth_event\fR\|(3). But always
+ keep in mind that you have to always supply \fIpointers\fR to \fIvariables\fR and
+ these variables have to be of the same type as the argument of \fIpth_event\fR\|(3)
+ required.
+ .Ip "pth_event_t \fBpth_event_concat\fR(pth_event_t \fIev\fR, ...);" 4
+ This concatenates one or more additional event rings to the event ring \fIev\fR
+ and returns \fIev\fR. The end of the argument list has to be marked with a
+ \f(CWNULL\fR argument. Use this function to create real events rings out of the
+ single-event rings created by \fIpth_event\fR\|(3).
+ .Ip "pth_event_t \fBpth_event_isolate\fR(pth_event_t \fIev\fR);" 4
+ This isolates the event \fIev\fR from possibly appended events in the event ring.
+ When in \fIev\fR only one event exists, this returns \f(CWNULL\fR. When remaining
+ events exists, they form a new event ring which is returned.
+ .Ip "pth_event_t \fBpth_event_walk\fR(pth_event_t \fIev\fR, int \fIdirection\fR);" 4
+ This walks to the next (when \fIdirection\fR is \f(CWPTH_WALK_NEXT\fR) or previews
+ (when \fIdirection\fR is \f(CWPTH_WALK_PREV\fR) event in the event ring \fIev\fR and
+ returns this new reached event. Additionally \f(CWPTH_UNTIL_OCCURRED\fR can be
+ \s-1OR\s0\-ed into \fIdirection\fR to walk to the next/previous occurred event in the
+ ring \fIev\fR.
+ .Ip "int \fBpth_event_occurred\fR(pth_event_t \fIev\fR);" 4
+ This checks whether the event \fIev\fR occurred. This is a fast operation because
+ only a tag on \fIev\fR is checked which was either set or still not set by the
+ scheduler. In other words: This doesn't check the event itself, it just checks
+ the last knowledge of the scheduler.
+ .Ip "int \fBpth_event_free\fR(pth_event_t \fIev\fR, int \fImode\fR);" 4
+ This deallocates the event \fIev\fR (when \fImode\fR is \f(CWPTH_FREE_THIS\fR) or all
+ events appended to the event ring under \fIev\fR (when \fImode\fR is
+ \f(CWPTH_FREE_ALL\fR).
+ .Sh "Key-Based Storage"
+ The following functions provide thread-local storage through unique keys
+ similar to the \s-1POSIX\s0 \fBPthread\fR \s-1API\s0. Use this for thread specific global data.
+ .Ip "int \fBpth_key_create\fR(pth_key_t *\fIkey\fR, void (*\fIfunc\fR)(void *));" 4
+ This created a new unique key and stores it in \fIkey\fR.  Additionally \fIfunc\fR
+ can specify a destructor function which is called on the current threads
+ termination with the \fIkey\fR.
+ .Ip "int \fBpth_key_delete\fR(pth_key_t \fIkey\fR);" 4
+ This explicitly destroys a key \fIkey\fR.
+ .Ip "int \fBpth_key_setdata\fR(pth_key_t \fIkey\fR, const void *\fIvalue\fR);" 4
+ This stores \fIvalue\fR under \fIkey\fR.
+ .Ip "void *\fBpth_key_getdata\fR(pth_key_t \fIkey\fR);" 4
+ This retrieves the value under \fIkey\fR.
+ .Sh "Message Port Communication"
+ The following functions provide message ports which can be used for efficient
+ and flexible inter-thread communication.
+ .Ip "pth_msgport_t \fBpth_msgport_create\fR(const char *\fIname\fR);" 4
+ This returns a pointer to a new message port with name \fIname\fR. The \fIname\fR
+ can be used by other threads via \fIpth_msgport_find\fR\|(3) to find the message port
+ in case they do not know directly the pointer to the message port.
+ .Ip "void \fBpth_msgport_destroy\fR(pth_msgport_t \fImp\fR);" 4
+ This destroys a message port \fImp\fR. Before all pending messages on it are
+ replied to their origin message port.
+ .Ip "pth_msgport_t \fBpth_msgport_find\fR(const char *\fIname\fR);" 4
+ This finds a message port in the system by \fIname\fR and returns the pointer to
+ it.
+ .Ip "int \fBpth_msgport_pending\fR(pth_msgport_t \fImp\fR);" 4
+ This returns the number of pending messages on message port \fImp\fR.
+ .Ip "int \fBpth_msgport_put\fR(pth_msgport_t \fImp\fR, pth_message_t *\fIm\fR);" 4
+ This puts (or sends) a message \fIm\fR to message port \fImp\fR.
+ .Ip "pth_message_t *\fBpth_msgport_get\fR(pth_msgport_t \fImp\fR);" 4
+ This gets (or receives) the top message from message port \fImp\fR.  Incoming
+ messages are always kept in a queue, so there can be more pending messages, of
+ course.
+ .Ip "int \fBpth_msgport_reply\fR(pth_message_t *\fIm\fR);" 4
+ This replies a message \fIm\fR to the message port of the sender.
+ .Sh "Thread Cleanups"
+ The following functions provide per-thread cleanup functions.
+ .Ip "int \fBpth_cleanup_push\fR(void (*\fIhandler\fR)(void *), void *\fIarg\fR);" 4
+ This pushes the routine \fIhandler\fR onto the stack of cleanup routines for the
+ current thread.  These routines are called in \s-1LIFO\s0 order when the thread
+ terminates.
+ .Ip "int \fBpth_cleanup_pop\fR(int \fIexecute\fR);" 4
+ This pops the top-most routine from the stack of cleanup routines for the
+ current thread. When \fIexecute\fR is \f(CWTRUE\fR the routine is additionally called.
+ .Sh "Process Forking"
+ The following functions provide some special support for process forking
+ situations inside the threading environment.
+ .Ip "int \fBpth_atfork_push\fR(void (*\fIprepare\fR)(void *), void (*)(void *\fIparent\fR), void (*)(void *\fIchild\fR), void *\fIarg\fR);" 4
+ This function declares forking handlers to be called before and after
+ \fIpth_fork\fR\|(3), in the context of the thread that called \fIpth_fork\fR\|(3). The
+ \fIprepare\fR handler is called before \fIfork\fR\|(2) processing commences. The
+ \fIparent\fR handler is called   after \fIfork\fR\|(2) processing completes in the parent
+ process.  The \fIchild\fR handler is called after \fIfork\fR\|(2) processing completed in
+ the child process. If no handling is desired at one or more of these three
+ points, the corresponding handler can be given as \f(CWNULL\fR.  Each handler is
+ called with \fIarg\fR as the argument.
+ .Sp
+ The order of calls to \fIpth_atfork_push\fR\|(3) is significant. The \fIparent\fR and
+ \fIchild\fR handlers are called in the order in which they were established by
+ calls to \fIpth_atfork_push\fR\|(3), i.e., \s-1FIFO\s0. The \fIprepare\fR fork handlers are
+ called in the opposite order, i.e., \s-1LIFO\s0.
+ .Ip "int \fBpth_atfork_pop\fR(void);" 4
+ This removes the top-most handlers on the forking handler stack which were
+ established with the last \fIpth_atfork_push\fR\|(3) call. It returns \f(CWFALSE\fR when no
+ more handlers couldn't be removed from the stack.
+ .Ip "pid_t \fBpth_fork\fR(void);" 4
+ This is a variant of \fIfork\fR\|(2) with the difference that the current thread only
+ is forked into a separate process, i.e., in the parent process nothing changes
+ while in the child process all threads are gone except for the scheduler and
+ the calling thread. When you really want to duplicate all threads in the
+ current process you should use \fIfork\fR\|(2) directly. But this is usually not
+ reasonable. Additionally this function takes care of forking handlers as
+ established by \fIpth_fork_push\fR\|(3).
+ .Sh "Synchronization"
+ The following functions provide synchronization support via mutual exclusion
+ locks (\fBmutex\fR), read-write locks (\fBrwlock\fR), condition variables (\fBcond\fR)
+ and barriers (\fBbarrier\fR). Keep in mind that in a non-preemptive threading
+ system like \fBPth\fR this might sound unnecessary at the first look, because a
+ thread isn't interrupted by the system. Actually when you have a critical code
+ section which doesn't contain any \fIpth_xxx()\fR functions, you don't need any
+ mutex to protect it, of course.
+ .PP
+ But when your critical code section contains any \fIpth_xxx()\fR function the chance
+ is high that these temporarily switch to the scheduler. And this way other
+ threads can make progress and enter your critical code section, too.  This is
+ especially true for critical code sections which implicitly or explicitly use
+ the event mechanism.
+ .Ip "int \fBpth_mutex_init\fR(pth_mutex_t *\fImutex\fR);" 4
+ This dynamically initializes a mutex variable of type `\f(CWpth_mutex_t\fR\*(R'.
+ Alternatively one can also use static initialization via `\f(CWpth_mutex_t
+ mutex = PTH_MUTEX_INIT\fR\*(R'.
+ .Ip "int \fBpth_mutex_acquire\fR(pth_mutex_t *\fImutex\fR, int \fItry\fR, pth_event_t \fIev\fR);" 4
+ This acquires a mutex \fImutex\fR.  If the mutex is already locked by another
+ thread, the current threads execution is suspended until the mutex is unlocked
+ again or additionally the extra events in \fIev\fR occurred (when \fIev\fR is not
+ \f(CWNULL\fR).  Recursive locking is explicitly supported, i.e., a thread is allowed
+ to acquire a mutex more than once before its released. But it then also has be
+ released the same number of times until the mutex is again lockable by others.
+ When \fItry\fR is \f(CWTRUE\fR this function never suspends execution. Instead it
+ returns \f(CWFALSE\fR with \f(CWerrno\fR set to \f(CWEBUSY\fR.
+ .Ip "int \fBpth_mutex_release\fR(pth_mutex_t *\fImutex\fR);" 4
+ This decrements the recursion locking count on \fImutex\fR and when it is zero it
+ releases the mutex \fImutex\fR.
+ .Ip "int \fBpth_rwlock_init\fR(pth_rwlock_t *\fIrwlock\fR);" 4
+ This dynamically initializes a read-write lock variable of type
+ `\f(CWpth_rwlock_t\fR\*(R'.  Alternatively one can also use static initialization
+ via `\f(CWpth_rwlock_t rwlock = PTH_RWLOCK_INIT\fR\*(R'.
+ .Ip "int \fBpth_rwlock_acquire\fR(pth_rwlock_t *\fIrwlock\fR, int \fIop\fR, int \fItry\fR, pth_event_t \fIev\fR);" 4
+ This acquires a read-only (when \fIop\fR is \f(CWPTH_RWLOCK_RD\fR) or a read-write
+ (when \fIop\fR is \f(CWPTH_RWLOCK_RW\fR) lock \fIrwlock\fR. When the lock is only locked
+ by other threads in read-only mode, the lock succeeds.  But when one thread
+ holds a read-write lock, all locking attempts suspend the current thread until
+ this lock is released again. Additionally in \fIev\fR events can be given to let
+ the locking timeout, etc. When \fItry\fR is \f(CWTRUE\fR this function never suspends
+ execution. Instead it returns \f(CWFALSE\fR with \f(CWerrno\fR set to \f(CWEBUSY\fR.
+ .Ip "int \fBpth_rwlock_release\fR(pth_rwlock_t *\fIrwlock\fR);" 4
+ This releases a previously acquired (read-only or read-write) lock.
+ .Ip "int \fBpth_cond_init\fR(pth_cond_t *\fIcond\fR);" 4
+ This dynamically initializes a condition variable variable of type
+ `\f(CWpth_cond_t\fR\*(R'.  Alternatively one can also use static initialization via
+ `\f(CWpth_cond_t cond = PTH_COND_INIT\fR\*(R'.
+ .Ip "int \fBpth_cond_await\fR(pth_cond_t *\fIcond\fR, pth_mutex_t *\fImutex\fR, pth_event_t \fIev\fR);" 4
+ This awaits a condition situation. The caller has to follow the semantics of
+ the \s-1POSIX\s0 condition variables: \fImutex\fR has to be acquired before this
+ function is called. The execution of the current thread is then suspended
+ either until the events in \fIev\fR occurred (when \fIev\fR is not \f(CWNULL\fR) or
+ \fIcond\fR was notified by another thread via \fIpth_cond_notify\fR\|(3).  While the
+ thread is waiting, \fImutex\fR is released. Before it returns \fImutex\fR is
+ reacquired.
+ .Ip "int \fBpth_cond_notify\fR(pth_cond_t *\fIcond\fR, int \fIbroadcast\fR);" 4
+ This notified one or all threads which are waiting on \fIcond\fR.  When
+ \fIbroadcast\fR is \f(CWTRUE\fR all thread are notified, else only a single
+ (unspecified) one.
+ .Ip "int \fBpth_barrier_init\fR(pth_barrier_t *\fIbarrier\fR, int I<threshold);" 4
+ This dynamically initializes a barrier variable of type `\f(CWpth_barrier_t\fR\*(R'.
+ Alternatively one can also use static initialization via `\f(CWpth_barrier_t
+ barrier = PTH_BARRIER_INIT(\fR\fIthreadhold\fR\f(CW)\fR\*(R'.
+ .Ip "int \fBpth_barrier_reach\fR(pth_barrier_t *\fIbarrier\fR);" 4
+ This function reaches a barrier \fIbarrier\fR. If this is the last thread (as
+ specified by \fIthreshold\fR on init of \fIbarrier\fR) all threads are awakened.
+ Else the current thread is suspended until the last thread reached the barrier
+ and this way awakes all threads. The function returns (beside \f(CWFALSE\fR on
+ error) the value \f(CWTRUE\fR for any thread which neither reached the barrier as
+ the first nor the last thread; \f(CWPTH_BARRIER_HEADLIGHT\fR for the thread which
+ reached the barrier as the first thread and \f(CWPTH_BARRIER_TAILLIGHT\fR for the
+ thread which reached the barrier as the last thread.
+ .Sh "Generalized \s-1POSIX\s0 Replacement \s-1API\s0"
+ The following functions are generalized replacements functions for the \s-1POSIX\s0
+ \s-1API\s0, i.e., they are similar to the functions under `\fBStandard \s-1POSIX\s0
+ Replacement \s-1API\s0\fR\*(R' but all have an additional event argument which can be used
+ for timeouts, etc.
+ .Ip "int \fBpth_sigwait_ev\fR(const sigset_t *\fIset\fR, int *\fIsig\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_sigwait\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_sigwait\fR\|(3) suspends the current threads execution it
+ usually only uses the signal event on \fIset\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "int \fBpth_connect_ev\fR(int \fIs\fR, const struct sockaddr *\fIaddr\fR, socklen_t \fIaddrlen\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_connect\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_connect\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "int \fBpth_accept_ev\fR(int \fIs\fR, struct sockaddr *\fIaddr\fR, socklen_t *\fIaddrlen\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_accept\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_accept\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "int \fBpth_select_ev\fR(int \fInfd\fR, fd_set *\fIrfds\fR, fd_set *\fIwfds\fR, fd_set *\fIefds\fR, struct timeval *\fItimeout\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_select\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_select\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIrfds\fR, \fIwfds\fR and \fIefds\fR to awake. With
+ this function any number of extra events can be used to awake the current
+ thread (remember that \fIev\fR actually is an event \fIring\fR).
+ .Ip "int \fBpth_poll_ev\fR(struct pollfd *\fIfds\fR, unsigned int \fInfd\fR, int \fItimeout\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_poll\fR\|(3) (see below), but has an additional event argument
+ \fIev\fR. When \fIpth_poll\fR\|(3) suspends the current threads execution it usually only
+ uses the I/O event on \fIfds\fR to awake. With this function any number of extra
+ events can be used to awake the current thread (remember that \fIev\fR actually
+ is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_read_ev\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_read\fR\|(3) (see below), but has an additional event argument
+ \fIev\fR. When \fIpth_read\fR\|(3) suspends the current threads execution it usually only
+ uses the I/O event on \fIfd\fR to awake. With this function any number of extra
+ events can be used to awake the current thread (remember that \fIev\fR actually
+ is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_readv_ev\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_readv\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_readv\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_write_ev\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_write\fR\|(3) (see below), but has an additional event argument
+ \fIev\fR. When \fIpth_write\fR\|(3) suspends the current threads execution it usually
+ only uses the I/O event on \fIfd\fR to awake. With this function any number of
+ extra events can be used to awake the current thread (remember that \fIev\fR
+ actually is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_writev_ev\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_writev\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_writev\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_recv_ev\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_recv\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_recv\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_recvfrom_ev\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, struct sockaddr *\fIfrom\fR, socklen_t *\fIfromlen\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_recvfrom\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_recvfrom\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_send_ev\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_send\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_send\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Ip "ssize_t \fBpth_sendto_ev\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, const struct sockaddr *\fIto\fR, socklen_t \fItolen\fR, pth_event_t \fIev\fR);" 4
+ This is equal to \fIpth_sendto\fR\|(3) (see below), but has an additional event
+ argument \fIev\fR. When \fIpth_sendto\fR\|(3) suspends the current threads execution it
+ usually only uses the I/O event on \fIfd\fR to awake. With this function any
+ number of extra events can be used to awake the current thread (remember that
+ \fIev\fR actually is an event \fIring\fR).
+ .Sh "Standard \s-1POSIX\s0 Replacement \s-1API\s0"
+ The following functions are standard replacements functions for the \s-1POSIX\s0 \s-1API\s0.
+ The difference is mainly that they suspend the current thread only instead of
+ the whole process in case the file descriptors will block.
+ .Ip "int \fBpth_usleep\fR(unsigned int \fIusec\fR);" 4
+ This is a variant of the 4.3BSD \fIusleep\fR\|(3) function. It suspends the current
+ threads execution until \fIusec\fR microsecond (= \fIusec\fR * 1/1000000 sec)
+ elapsed.  The thread is guaranteed to not awakened before this time, but
+ because of the non-preemptive scheduling nature of \fBPth\fR, it can be awakened
+ later, of course.  The difference between \fIusleep\fR\|(3) and \fIpth_usleep\fR\|(3) is that
+ that \fIpth_usleep\fR\|(3) suspends only the execution of the current thread and not
+ the whole process.
+ .Ip "unsigned int \fBpth_sleep\fR(unsigned int \fIsec\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIsleep\fR\|(3) function. It
+ suspends the current threads execution until \fIsec\fR seconds elapsed.  The
+ thread is guaranteed to not awakened before this time, but because of the
+ non-preemptive scheduling nature of \fBPth\fR, it can be awakened later, of
+ course.  The difference between \fIsleep\fR\|(3) and \fIpth_sleep\fR\|(3) is that that
+ \fIpth_sleep\fR\|(3) suspends only the execution of the current thread and not the
+ whole process.
+ .Ip "pid_t \fBpth_waitpid\fR(pid_t \fIpid\fR, int *\fIstatus\fR, int \fIoptions\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIwaitpid\fR\|(2) function. It suspends the
+ current threads execution until \fIstatus\fR information is available for a
+ terminated child process \fIpid\fR.  The difference between \fIwaitpid\fR\|(2) and
+ \fIpth_waitpid\fR\|(3) is that that \fIpth_waitpid\fR\|(3) suspends only the execution of the
+ current thread and not the whole process.  For more details about the
+ arguments and return code semantics see \fIwaitpid\fR\|(2).
+ .Ip "int \fBpth_sigmask\fR(int \fIhow\fR, const sigset_t *\fIset\fR, sigset_t *\fIoset\fR)" 4
+ This is the \fBPth\fR thread-related equivalent of \s-1POSIX\s0 \fIsigprocmask\fR\|(2) respectively
+ \fIpthread_sigmask\fR\|(3). The arguments \fIhow\fR, \fIset\fR and \fIoset\fR directly relate
+ to \fIsigprocmask\fR\|(2), because \fBPth\fR internally just uses \fIsigprocmask\fR\|(2) here. So
+ alternatively you can also directly call \fIsigprocmask\fR\|(2), but for consistency
+ reasons you should use this function \fIpth_sigmask\fR\|(3).
+ .Ip "int \fBpth_sigwait\fR(const sigset_t *\fIset\fR, int *\fIsig\fR);" 4
+ This is a variant of the \s-1POSIX\s0.1c \fIsigwait\fR\|(3) function. It suspends the current
+ threads execution until a signal in \fIset\fR occurred and stores the signal
+ number in \fIsig\fR. The important point is that the signal is not delivered to a
+ signal handler. Instead it's caught by the scheduler only in order to awake
+ the \fIpth_sigwait()\fR call. The trick and noticeable point here is that this way
+ you get an asynchronous aware application that is written completely
+ synchronously. When you think about the problem of \fIasynchronous safe\fR
+ functions you should recognize that this is a great benefit.
+ .Ip "int \fBpth_connect\fR(int \fIs\fR, const struct sockaddr *\fIaddr\fR, socklen_t \fIaddrlen\fR);" 4
+ This is a variant of the 4.2BSD \fIconnect\fR\|(2) function. It establishes a
+ connection on a socket \fIs\fR to target specified in \fIaddr\fR and \fIaddrlen\fR.
+ The difference between \fIconnect\fR\|(2) and \fIpth_connect\fR\|(3) is that that
+ \fIpth_connect\fR\|(3) suspends only the execution of the current thread and not the
+ whole process.  For more details about the arguments and return code semantics
+ see \fIconnect\fR\|(2).
+ .Ip "int \fBpth_accept\fR(int \fIs\fR, struct sockaddr *\fIaddr\fR, socklen_t *\fIaddrlen\fR);" 4
+ This is a variant of the 4.2BSD \fIaccept\fR\|(2) function. It accepts a connection on
+ a socket by extracting the first connection request on the queue of pending
+ connections, creating a new socket with the same properties of \fIs\fR and
+ allocates a new file descriptor for the socket (which is returned).  The
+ difference between \fIaccept\fR\|(2) and \fIpth_accept\fR\|(3) is that that \fIpth_accept\fR\|(3)
+ suspends only the execution of the current thread and not the whole process.
+ For more details about the arguments and return code semantics see \fIaccept\fR\|(2).
+ .Ip "int \fBpth_select\fR(int \fInfd\fR, fd_set *\fIrfds\fR, fd_set *\fIwfds\fR, fd_set *\fIefds\fR, struct timeval *\fItimeout\fR);" 4
+ This is a variant of the 4.2BSD \fIselect\fR\|(2) function.  It examines the I/O
+ descriptor sets whose addresses are passed in \fIrfds\fR, \fIwfds\fR, and \fIefds\fR to
+ see if some of their descriptors are ready for reading, are ready for writing,
+ or have an exceptional condition pending, respectively.  For more details
+ about the arguments and return code semantics see \fIselect\fR\|(2).
+ .Ip "int \fBpth_poll\fR(struct pollfd *\fIfds\fR, unsigned int \fInfd\fR, int \fItimeout\fR);" 4
+ This is a variant of the SysV \fIpoll\fR\|(2) function. It examines the I/O
+ descriptors which are passed in the array \fIfds\fR to see if some of them are
+ ready for reading, are ready for writing, or have an exceptional condition
+ pending, respectively. For more details about the arguments and return code
+ semantics see \fIpoll\fR\|(2).
+ .Ip "ssize_t \fBpth_read\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIread\fR\|(2) function. It reads up to \fInbytes\fR
+ bytes into \fIbuf\fR from file descriptor \fIfd\fR.  The difference between \fIread\fR\|(2)
+ and \fIpth_read\fR\|(2) is that that \fIpth_read\fR\|(2) suspends execution of the current
+ thread until the file descriptor is ready for reading. For more details about
+ the arguments and return code semantics see \fIread\fR\|(2).
+ .Ip "ssize_t \fBpth_readv\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIreadv\fR\|(2) function. It reads data from
+ file descriptor \fIfd\fR into the first \fIiovcnt\fR rows of the \fIiov\fR vector.  The
+ difference between \fIreadv\fR\|(2) and \fIpth_readv\fR\|(2) is that that \fIpth_readv\fR\|(2)
+ suspends execution of the current thread until the file descriptor is ready for
+ reading. For more details about the arguments and return code semantics see
+ \fIreadv\fR\|(2).
+ .Ip "ssize_t \fBpth_write\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIwrite\fR\|(2) function. It writes \fInbytes\fR bytes
+ from \fIbuf\fR to file descriptor \fIfd\fR.  The difference between \fIwrite\fR\|(2) and
+ \fIpth_write\fR\|(2) is that that \fIpth_write\fR\|(2) suspends execution of the current
+ thread until the file descriptor is ready for writing.  For more details about
+ the arguments and return code semantics see \fIwrite\fR\|(2).
+ .Ip "ssize_t \fBpth_writev\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIwritev\fR\|(2) function. It writes data to
+ file descriptor \fIfd\fR from the first \fIiovcnt\fR rows of the \fIiov\fR vector.  The
+ difference between \fIwritev\fR\|(2) and \fIpth_writev\fR\|(2) is that that \fIpth_writev\fR\|(2)
+ suspends execution of the current thread until the file descriptor is ready for
+ reading. For more details about the arguments and return code semantics see
+ \fIwritev\fR\|(2).
+ .Ip "ssize_t \fBpth_pread\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, off_t \fIoffset\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIpread\fR\|(3) function.  It performs the same action
+ as a regular \fIread\fR\|(2), except that it reads from a given position in the file
+ without changing the file pointer.  The first three arguments are the same as
+ for \fIpth_read\fR\|(3) with the addition of a fourth argument \fIoffset\fR for the
+ desired position inside the file.
+ .Ip "ssize_t \fBpth_pwrite\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, off_t \fIoffset\fR);" 4
+ This is a variant of the \s-1POSIX\s0 \fIpwrite\fR\|(3) function.  It performs the same
+ action as a regular \fIwrite\fR\|(2), except that it writes to a given position in the
+ file without changing the file pointer. The first three arguments are the same
+ as for \fIpth_write\fR\|(3) with the addition of a fourth argument \fIoffset\fR for the
+ desired position inside the file.
+ .Ip "ssize_t \fBpth_recv\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR);" 4
+ This is a variant of the SUSv2 \fIrecv\fR\|(2) function and equal to
+ ``\fIpth_recvfrom\fR\|(fd, buf, nbytes, flags, \s-1NULL\s0, 0)'\*(R'.
+ .Ip "ssize_t \fBpth_recvfrom\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, struct sockaddr *\fIfrom\fR, socklen_t *\fIfromlen\fR);" 4
+ This is a variant of the SUSv2 \fIrecvfrom\fR\|(2) function. It reads up to
+ \fInbytes\fR bytes into \fIbuf\fR from file descriptor \fIfd\fR while using
+ \fIflags\fR and \fIfrom\fR/\fIfromlen\fR. The difference between \fIrecvfrom\fR\|(2) and
+ \fIpth_recvfrom\fR\|(2) is that that \fIpth_recvfrom\fR\|(2) suspends execution of the
+ current thread until the file descriptor is ready for reading. For more
+ details about the arguments and return code semantics see \fIrecvfrom\fR\|(2).
+ .Ip "ssize_t \fBpth_send\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR);" 4
+ This is a variant of the SUSv2 \fIsend\fR\|(2) function and equal to
+ ``\fIpth_sendto\fR\|(fd, buf, nbytes, flags, \s-1NULL\s0, 0)'\*(R'.
+ .Ip "ssize_t \fBpth_sendto\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, const struct sockaddr *\fIto\fR, socklen_t \fItolen\fR);" 4
+ This is a variant of the SUSv2 \fIsendto\fR\|(2) function. It writes \fInbytes\fR
+ bytes from \fIbuf\fR to file descriptor \fIfd\fR while using \fIflags\fR and
+ \fIto\fR/\fItolen\fR. The difference between \fIsendto\fR\|(2) and \fIpth_sendto\fR\|(2) is
+ that that \fIpth_sendto\fR\|(2) suspends execution of the current thread until
+ the file descriptor is ready for writing. For more details about the
+ arguments and return code semantics see \fIsendto\fR\|(2).
+ .SH "EXAMPLE"
+ The following example is a useless server which does nothing more than
+ listening on TCP port 12345 and displaying the current time to the
+ socket when a connection was established. For each incoming connection a
+ thread is spawned. Additionally, to see more multithreading, a useless
+ ticker thread runs simultaneously which outputs the current time to
+ \f(CWstderr\fR every 5 seconds. The example contains \fIno\fR error checking and
+ is \fIonly\fR intended to show you the look and feel of \fBPth\fR.
+ .PP
+ .Vb 11
+ \& #include <stdio.h>
+ \& #include <stdlib.h>
+ \& #include <errno.h>
+ \& #include <sys/types.h>
+ \& #include <sys/socket.h>
+ \& #include <netinet/in.h>
+ \& #include <arpa/inet.h>
+ \& #include <signal.h>
+ \& #include <netdb.h>
+ \& #include <unistd.h>
+ \& #include "pth.h"
+ .Ve
+ .Vb 1
+ \& #define PORT 12345
+ .Ve
+ .Vb 6
+ \& /* the socket connection handler thread */
+ \& static void *handler(void *_arg)
+ \& {
+ \&     int fd = (int)_arg;
+ \&     time_t now;
+ \&     char *ct;
+ .Ve
+ .Vb 6
+ \&     now = time(NULL);
+ \&     ct = ctime(&now);
+ \&     pth_write(fd, ct, strlen(ct));
+ \&     close(fd);
+ \&     return NULL;
+ \& }
+ .Ve
+ .Vb 6
+ \& /* the stderr time ticker thread */
+ \& static void *ticker(void *_arg)
+ \& {
+ \&     time_t now;
+ \&     char *ct;
+ \&     float load;
+ .Ve
+ .Vb 9
+ \&     for (;;) {
+ \&         pth_sleep(5);
+ \&         now = time(NULL);
+ \&         ct = ctime(&now);
+ \&         ct[strlen(ct)-1] = '\e0';
+ \&         pth_ctrl(PTH_CTRL_GETAVLOAD, &load);
+ \&         printf("ticker: time: %s, average load: %.2f\en", ct, load);
+ \&     }
+ \& }
+ .Ve
+ .Vb 10
+ \& /* the main thread/procedure */
+ \& int main(int argc, char *argv[])
+ \& {
+ \&     pth_attr_t attr;
+ \&     struct sockaddr_in sar;
+ \&     struct protoent *pe;
+ \&     struct sockaddr_in peer_addr;
+ \&     int peer_len;
+ \&     int sa, sw;
+ \&     int port;
+ .Ve
+ .Vb 2
+ \&     pth_init();
+ \&     signal(SIGPIPE, SIG_IGN);
+ .Ve
+ .Vb 5
+ \&     attr = pth_attr_new();
+ \&     pth_attr_set(attr, PTH_ATTR_NAME, "ticker");
+ \&     pth_attr_set(attr, PTH_ATTR_STACK_SIZE, 64*1024);
+ \&     pth_attr_set(attr, PTH_ATTR_JOINABLE, FALSE);
+ \&     pth_spawn(attr, ticker, NULL);
+ .Ve
+ .Vb 7
+ \&     pe = getprotobyname("tcp");
+ \&     sa = socket(AF_INET, SOCK_STREAM, pe->p_proto);
+ \&     sar.sin_family = AF_INET;
+ \&     sar.sin_addr.s_addr = INADDR_ANY;
+ \&     sar.sin_port = htons(PORT);
+ \&     bind(sa, (struct sockaddr *)&sar, sizeof(struct sockaddr_in));
+ \&     listen(sa, 10);
+ .Ve
+ .Vb 7
+ \&     pth_attr_set(attr, PTH_ATTR_NAME, "handler");
+ \&     for (;;) {
+ \&         peer_len = sizeof(peer_addr);
+ \&         sw = pth_accept(sa, (struct sockaddr *)&peer_addr, &peer_len);
+ \&         pth_spawn(attr, handler, (void *)sw);
+ \&     }
+ \& }
+ .Ve
+ .SH "BUILD ENVIRONMENTS"
+ In this section we will discuss the canonical ways to establish the build
+ environment for a \fBPth\fR based program. The possibilities supported by \fBPth\fR
+ range from very simple environments to rather complex ones.
+ .Sh "Manual Build Environment (Novice)"
+ As a first example, assume we have the above test program staying in the
+ source file \f(CWfoo.c\fR. Then we can create a very simple build environment by
+ just adding the following \f(CWMakefile\fR:
+ .PP
+ .Vb 13
+ \& $ vi Makefile
+ \& | CC      = cc
+ \& | CFLAGS  = `pth-config --cflags`
+ \& | LDFLAGS = `pth-config --ldflags`
+ \& | LIBS    = `pth-config --libs`
+ \& |
+ \& | all: foo
+ \& | foo: foo.o
+ \& |     $(CC) $(LDFLAGS) -o foo foo.o $(LIBS)
+ \& | foo.o: foo.c
+ \& |     $(CC) $(CFLAGS) -c foo.c
+ \& | clean:
+ \& |     rm -f foo foo.o
+ .Ve
+ This imports the necessary compiler and linker flags on-the-fly from the
+ \fBPth\fR installation via its \f(CWpth-config\fR program. This approach is
+ straight-foreward and works fine for small projects.
+ .Sh "Autoconf Build Environment (Advanced)"
+ The previous approach is simple but unflexible. First, to speed up
+ building, it would be nice to not expand the compiler and linker flags
+ every time the compiler is started. Second, it would be useful to
+ also be able to build against an uninstalled \fBPth\fR, that is, against
+ a \fBPth\fR source tree which was just configured and built, but not
+ installed. Third, it would be also useful to allow checking of the
+ \fBPth\fR version to make sure it is at least a minimum required version.
+ And finally, it would be also great to make sure \fBPth\fR works correctly
+ by first performing some sanity compile and run-time checks. All this
+ can be done if we use \s-1GNU\s0 \fBautoconf\fR and the \f(CWAC_CHECK_PTH\fR macro
+ provided by \fBPth\fR. For this, we establish the following three files:
+ .PP
+ First we again need the \f(CWMakefile\fR, but this time it contains \fBautoconf\fR
+ placeholders and additional cleanup targets. And we create it under the name
+ \f(CWMakefile.in\fR, because it is now an input file for \fBautoconf\fR:
+ .PP
+ .Vb 17
+ \& $ vi Makefile.in
+ \& | CC      = @CC@
+ \& | CFLAGS  = @CFLAGS@
+ \& | LDFLAGS = @LDFLAGS@
+ \& | LIBS    = @LIBS@
+ \& |
+ \& | all: foo
+ \& | foo: foo.o
+ \& |     $(CC) $(LDFLAGS) -o foo foo.o $(LIBS)
+ \& | foo.o: foo.c
+ \& |     $(CC) $(CFLAGS) -c foo.c
+ \& | clean:
+ \& |     rm -f foo foo.o
+ \& | distclean:
+ \& |     rm -f foo foo.o
+ \& |     rm -f config.log config.status config.cache
+ \& |     rm -f Makefile
+ .Ve
+ Because \fBautoconf\fR generates additional files, we added a canonical
+ \f(CWdistclean\fR target which cleanups this, too. Second, we write
+ a (minimalistic) \fBautoconf\fR script specification in a file
+ \f(CWconfigure.in\fR:
+ .PP
+ .Vb 4
+ \& $ vi configure.in
+ \& | AC_INIT(Makefile.in)
+ \& | AC_CHECK_PTH(1.3.0)
+ \& | AC_OUTPUT(Makefile)
+ .Ve
+ Then we let \fBautoconf\fR's \f(CWaclocal\fR program generate for us an \f(CWaclocal.m4\fR
+ file containing \fBPth\fR's \f(CWAC_CHECK_PTH\fR macro. Then we generate the final
+ \f(CWconfigure\fR script out of this \f(CWaclocal.m4\fR file and the \f(CWconfigure.in\fR
+ file:
+ .PP
+ .Vb 2
+ \& $ aclocal --acdir=`pth-config --acdir`
+ \& $ autoconf
+ .Ve
+ After these steps, the working directory should look similar to this:
+ .PP
+ .Vb 6
+ \& $ ls -l
+ \& -rw-r--r--  1 rse  users    176 Nov  3 11:11 Makefile.in
+ \& -rw-r--r--  1 rse  users  15314 Nov  3 11:16 aclocal.m4
+ \& -rwxr-xr-x  1 rse  users  52045 Nov  3 11:16 configure
+ \& -rw-r--r--  1 rse  users     63 Nov  3 11:11 configure.in
+ \& -rw-r--r--  1 rse  users   4227 Nov  3 11:11 foo.c
+ .Ve
+ If we now run \f(CWconfigure\fR we get a correct \f(CWMakefile\fR which
+ immediately can be used to build \f(CWfoo\fR (assuming that \fBPth\fR is already
+ installed somewhere, so that \f(CWpth-config\fR is in \f(CW$PATH\fR):
+ .PP
+ .Vb 16
+ \& $ ./configure
+ \& creating cache ./config.cache
+ \& checking for gcc... gcc
+ \& checking whether the C compiler (gcc   ) works... yes
+ \& checking whether the C compiler (gcc   ) is a cross-compiler... no
+ \& checking whether we are using GNU C... yes
+ \& checking whether gcc accepts -g... yes
+ \& checking how to run the C preprocessor... gcc -E
+ \& checking for GNU Pth... version 1.3.0, installed under /usr/local
+ \& updating cache ./config.cache
+ \& creating ./config.status
+ \& creating Makefile
+ \& rse@en1:/e/gnu/pth/ac
+ \& $ make
+ \& gcc -g -O2 -I/usr/local/include -c foo.c
+ \& gcc -L/usr/local/lib -o foo foo.o -lpth
+ .Ve
+ If \fBPth\fR is installed in non-standard locations or \f(CWpth-config\fR
+ is not in \f(CW$PATH\fR, one just has to drop the \f(CWconfigure\fR script
+ a note about the location by running \f(CWconfigure\fR with the option
+ \f(CW--with-pth=\fR\fIdir\fR (where \fIdir\fR is the argument which was used with
+ the \f(CW--prefix\fR option when \fBPth\fR was installed).
+ .Sh "Autoconf Build Environment with Local Copy of Pth (Expert)"
+ Finally let us assume the \f(CWfoo\fR program stays under either a \fI\s-1GPL\s0\fR or
+ \fI\s-1LGPL\s0\fR distribution license and we want to make it a stand-alone package for
+ easier distribution and installation.  That is, we don't want that the
+ end-user first has to install \fBPth\fR just to allow our \f(CWfoo\fR package to
+ compile. For this, it is a convinient practice to include the required
+ libraries (here \fBPth\fR) into the source tree of the package (here \f(CWfoo\fR).
+ \fBPth\fR ships with all necessary support to allow us to easily achieve this
+ approach. Say, we want \fBPth\fR in a subdirectory named \f(CWpth/\fR and this
+ directory should be seamlessly integrated into the configuration and build
+ process of \f(CWfoo\fR.
+ .PP
+ First we again start with the \f(CWMakefile.in\fR, but this time it is a more
+ advanced version which supports subdirectory movement:
+ .PP
+ .Vb 34
+ \& $ vi Makefile.in
+ \& | CC      = @CC@
+ \& | CFLAGS  = @CFLAGS@
+ \& | LDFLAGS = @LDFLAGS@
+ \& | LIBS    = @LIBS@
+ \& |
+ \& | SUBDIRS = pth
+ \& |
+ \& | all: subdirs_all foo
+ \& |
+ \& | subdirs_all:
+ \& |     @$(MAKE) $(MFLAGS) subdirs TARGET=all
+ \& | subdirs_clean:
+ \& |     @$(MAKE) $(MFLAGS) subdirs TARGET=clean
+ \& | subdirs_distclean:
+ \& |     @$(MAKE) $(MFLAGS) subdirs TARGET=distclean
+ \& | subdirs:
+ \& |     @for subdir in $(SUBDIRS); do \e
+ \& |         echo "===> $$subdir ($(TARGET))"; \e
+ \& |         (cd $$subdir; $(MAKE) $(MFLAGS) $(TARGET) || exit 1) || exit 1; \e
+ \& |         echo "<=== $$subdir"; \e
+ \& |     done
+ \& |
+ \& | foo: foo.o
+ \& |     $(CC) $(LDFLAGS) -o foo foo.o $(LIBS)
+ \& | foo.o: foo.c
+ \& |     $(CC) $(CFLAGS) -c foo.c
+ \& |
+ \& | clean: subdirs_clean
+ \& |     rm -f foo foo.o
+ \& | distclean: subdirs_distclean
+ \& |     rm -f foo foo.o
+ \& |     rm -f config.log config.status config.cache
+ \& |     rm -f Makefile
+ .Ve
+ Then we create a slightly different \fBautoconf\fR script \f(CWconfigure.in\fR:
+ .PP
+ .Vb 6
+ \& $ vi configure.in
+ \& | AC_INIT(Makefile.in)
+ \& | AC_CONFIG_AUX_DIR(pth)
+ \& | AC_CHECK_PTH(1.3.0, subdir:pth --disable-tests)
+ \& | AC_CONFIG_SUBDIRS(pth)
+ \& | AC_OUTPUT(Makefile)
+ .Ve
+ Here we provided a default value for \f(CWfoo\fR's \f(CW--with-pth\fR option as the
+ second argument to \f(CWAC_CHECK_PTH\fR which indicates that \fBPth\fR can be found in
+ the subdirectory named \f(CWpth/\fR. Additionally we specified that the
+ \f(CW--disable-tests\fR option of \fBPth\fR should be passed to the \f(CWpth/\fR
+ subdirectory, because we need only to build the \fBPth\fR library itself. And we
+ added a \f(CWAC_CONFIG_SUBDIR\fR call which indicates to \fBautoconf\fR that it should
+ configure the \f(CWpth/\fR subdirectory, too. The \f(CWAC_CONFIG_AUX_DIR\fR directive
+ was added just to make \fBautoconf\fR happy, because it wants to find a
+ \f(CWinstall.sh\fR or \f(CWshtool\fR script if \f(CWAC_CONFIG_SUBDIRS\fR is used.
+ .PP
+ Now we let \fBautoconf\fR's \f(CWaclocal\fR program again generate for us an
+ \f(CWaclocal.m4\fR file with the contents of \fBPth\fR's \f(CWAC_CHECK_PTH\fR macro.
+ Finally we generate the \f(CWconfigure\fR script out of this \f(CWaclocal.m4\fR
+ file and the \f(CWconfigure.in\fR file.
+ .PP
+ .Vb 2
+ \& $ aclocal --acdir=`pth-config --acdir`
+ \& $ autoconf
+ .Ve
+ Now we have to create the \f(CWpth/\fR subdirectory itself. For this, we extract the
+ \fBPth\fR distribution to the \f(CWfoo\fR source tree and just rename it to \f(CWpth/\fR:
+ .PP
+ .Vb 2
+ \& $ gunzip <pth-X.Y.Z.tar.gz | tar xvf -
+ \& $ mv pth-X.Y.Z pth
+ .Ve
+ Optionally to reduce the size of the \f(CWpth/\fR subdirectory, we can strip down
+ the \fBPth\fR sources to a minimum with the \fIstriptease\fR feature:
+ .PP
+ .Vb 4
+ \& $ cd pth
+ \& $ ./configure
+ \& $ make striptease
+ \& $ cd ..
+ .Ve
+ After this the source tree of \f(CWfoo\fR should look similar to this:
+ .PP
+ .Vb 24
+ \& $ ls -l
+ \& -rw-r--r--  1 rse  users    709 Nov  3 11:51 Makefile.in
+ \& -rw-r--r--  1 rse  users  16431 Nov  3 12:20 aclocal.m4
+ \& -rwxr-xr-x  1 rse  users  57403 Nov  3 12:21 configure
+ \& -rw-r--r--  1 rse  users    129 Nov  3 12:21 configure.in
+ \& -rw-r--r--  1 rse  users   4227 Nov  3 11:11 foo.c
+ \& drwxr-xr-x  2 rse  users   3584 Nov  3 12:36 pth
+ \& $ ls -l pth/
+ \& -rw-rw-r--  1 rse  users   26344 Nov  1 20:12 COPYING
+ \& -rw-rw-r--  1 rse  users    2042 Nov  3 12:36 Makefile.in
+ \& -rw-rw-r--  1 rse  users    3967 Nov  1 19:48 README
+ \& -rw-rw-r--  1 rse  users     340 Nov  3 12:36 README.1st
+ \& -rw-rw-r--  1 rse  users   28719 Oct 31 17:06 config.guess
+ \& -rw-rw-r--  1 rse  users   24274 Aug 18 13:31 config.sub
+ \& -rwxrwxr-x  1 rse  users  155141 Nov  3 12:36 configure
+ \& -rw-rw-r--  1 rse  users  162021 Nov  3 12:36 pth.c
+ \& -rw-rw-r--  1 rse  users   18687 Nov  2 15:19 pth.h.in
+ \& -rw-rw-r--  1 rse  users    5251 Oct 31 12:46 pth_acdef.h.in
+ \& -rw-rw-r--  1 rse  users    2120 Nov  1 11:27 pth_acmac.h.in
+ \& -rw-rw-r--  1 rse  users    2323 Nov  1 11:27 pth_p.h.in
+ \& -rw-rw-r--  1 rse  users     946 Nov  1 11:27 pth_vers.c
+ \& -rw-rw-r--  1 rse  users   26848 Nov  1 11:27 pthread.c
+ \& -rw-rw-r--  1 rse  users   18772 Nov  1 11:27 pthread.h.in
+ \& -rwxrwxr-x  1 rse  users   26188 Nov  3 12:36 shtool
+ .Ve
+ Now when we configure and build the \f(CWfoo\fR package it looks similar to this:
+ .PP
+ .Vb 31
+ \& $ ./configure
+ \& creating cache ./config.cache
+ \& checking for gcc... gcc
+ \& checking whether the C compiler (gcc   ) works... yes
+ \& checking whether the C compiler (gcc   ) is a cross-compiler... no
+ \& checking whether we are using GNU C... yes
+ \& checking whether gcc accepts -g... yes
+ \& checking how to run the C preprocessor... gcc -E
+ \& checking for GNU Pth... version 1.3.0, local under pth
+ \& updating cache ./config.cache
+ \& creating ./config.status
+ \& creating Makefile
+ \& configuring in pth
+ \& running /bin/sh ./configure  --enable-subdir --enable-batch
+ \& --disable-tests --cache-file=.././config.cache --srcdir=.
+ \& loading cache .././config.cache
+ \& checking for gcc... (cached) gcc
+ \& checking whether the C compiler (gcc   ) works... yes
+ \& checking whether the C compiler (gcc   ) is a cross-compiler... no
+ \& [...]
+ \& $ make
+ \& ===> pth (all)
+ \& ./shtool scpp -o pth_p.h -t pth_p.h.in -Dcpp -Cintern -M '==#==' pth.c
+ \& pth_vers.c
+ \& gcc -c -I. -O2 -pipe pth.c
+ \& gcc -c -I. -O2 -pipe pth_vers.c
+ \& ar rc libpth.a pth.o pth_vers.o
+ \& ranlib libpth.a
+ \& <=== pth
+ \& gcc -g -O2 -Ipth -c foo.c
+ \& gcc -Lpth -o foo foo.o -lpth
+ .Ve
+ As you can see, \fBautoconf\fR now automatically configures the local
+ (stripped down) copy of \fBPth\fR in the subdirectory \f(CWpth/\fR and the
+ \f(CWMakefile\fR automatically builds the subdirectory, too.
+ .SH "SYSTEM CALL WRAPPER FACILITY"
+ \fBPth\fR per default uses an explicit API, including the system calls. For
+ instance you've to explicitly use \fIpth_read\fR\|(3) when you need a thread-aware
+ \fIread\fR\|(3) and cannot expect that by just calling \fIread\fR\|(3) only the current thread
+ is blocked. Instead with the standard \fIread\fR\|(3) call the whole process will be
+ blocked. But because for some applications (mainly those consisting of lots of
+ third-party stuff) this can be inconvenient.  Here it's required that a call
+ to \fIread\fR\|(3) `magically\*(R' means \fIpth_read\fR\|(3). The problem here is that such
+ magic \fBPth\fR cannot provide per default because it's not really portable.
+ Nevertheless \fBPth\fR provides a two step approach to solve this problem:
+ .Sh "Soft System Call Mapping"
+ This variant is available on all platforms and can \fIalways\fR be enabled by
+ building \fBPth\fR with \f(CW--enable-syscall-soft\fR. This then triggers some
+ \f(CW#define\fR's in the \f(CWpth.h\fR header which map for instance \fIread\fR\|(3) to
+ \fIpth_read\fR\|(3), etc.  Currently the following functions are mapped: \fIfork\fR\|(2),
+ \fIsleep\fR\|(3), \fIsigwait\fR\|(3), \fIwaitpid\fR\|(2), \fIselect\fR\|(2), \fIpoll\fR\|(2), \fIconnect\fR\|(2),
+ \fIaccept\fR\|(2), \fIread\fR\|(2), \fIwrite\fR\|(2).
+ .PP
+ The drawback of this approach is just that really all source files
+ of the application where these function calls occur have to include
+ \f(CWpth.h\fR, of course. And this also means that existing libraries,
+ including the vendor's \fBstdio\fR, usually will still block the whole
+ process if one of its I/O functions block.
+ .Sh "Hard System Call Mapping"
+ This variant is available only on those platforms where the \fIsyscall\fR\|(2)
+ function exists and there it can be enabled by building \fBPth\fR with
+ \f(CW--enable-syscall-hard\fR. This then builds wrapper functions (for instances
+ \fIread\fR\|(3)) into the \fBPth\fR library which internally call the real \fBPth\fR
+ replacement functions (\fIpth_read\fR\|(3)).  Currently the following functions are
+ mapped: \fIfork\fR\|(2), \fIsleep\fR\|(3), \fIwaitpid\fR\|(2), \fIselect\fR\|(2), \fIpoll\fR\|(2), \fIconnect\fR\|(2),
+ \fIaccept\fR\|(2), \fIread\fR\|(2), \fIwrite\fR\|(2).
+ .PP
+ The drawback of this approach is that it depends on \fIsyscall\fR\|(2) interface
+ and prototype conflicts can occur while building the wrapper functions
+ due to different function signatures in the vendor C header files.
+ But the advantage of this mapping variant is that the source files of
+ the application where these function calls occur have not to include
+ \f(CWpth.h\fR and that existing libraries, including the vendor's \fBstdio\fR,
+ magically become thread-aware (and then block only the current thread).
+ .SH "IMPLEMENTATION NOTES"
+ \fBPth\fR is very portable because it has only one part which perhaps has
+ to be ported to new platforms (the machine context initialization). But
+ it is written in a way which works on mostly all Unix platforms which
+ support \fImakecontext\fR\|(2) or at least \fIsigstack\fR\|(2) or \fIsigaltstack\fR\|(2) [see
+ \f(CWpth_mctx.c\fR for details]. Any other \fBPth\fR code is POSIX and ANSI C
+ based only.
+ .PP
+ The context switching is done via either SUSv2 \fImakecontext\fR\|(2) or POSIX
+ make[sig]\fIsetjmp\fR\|(3) and [sig]\fIlongjmp\fR\|(3). Here all CPU registers, the
+ program counter and the stack pointer are switched. Additionally the
+ \fBPth\fR dispatcher switches also the global Unix \f(CWerrno\fR variable [see
+ \f(CWpth_mctx.c\fR for details] and the signal mask (either implicitly via
+ \fIsigsetjmp\fR\|(3) or in an emulated way via explicit \fIsetprocmask\fR\|(2) calls).
+ .PP
+ The \fBPth\fR event manager is mainly \fIselect\fR\|(2) and \fIgettimeofday\fR\|(2) based,
+ i.e., the current time is fetched via \fIgettimeofday\fR\|(2) once per context
+ switch for time calculations and all I/O events are implemented via a
+ single central \fIselect\fR\|(2) call [see \f(CWpth_sched.c\fR for details].
+ .PP
+ The thread control block management is done via virtual priority
+ queues without any additional data structure overhead. For this, the
+ queue linkage attributes are part of the thread control blocks and the
+ queues are actually implemented as rings with a selected element as the
+ entry point [see \f(CWpth_tcb.h\fR and \f(CWpth_pqueue.c\fR for details].
+ .PP
+ Most time critical code sections (especially the dispatcher and event
+ manager) are speeded up by inlined functions (implemented as ANSI C
+ pre-processor macros). Additionally any debugging code is \fIcompletely\fR
+ removed from the source when not built with \f(CW-DPTH_DEBUG\fR (see Autoconf
+ \f(CW--enable-debug\fR option), i.e., not only stub functions remain [see
+ \f(CWpth_debug.h\fR for details].
+ .SH "RESTRICTIONS"
+ \fBPth\fR (intentionally) provides no replacements for non-thread-safe
+ functions (like \fIstrtok\fR\|(3) which uses a static internal buffer) or
+ synchronous system functions (like \fIgethostbyname\fR\|(3) which doesn't
+ provide an asynchronous mode where it doesn't block). When you want to
+ use those functions in your server application together with threads,
+ you've to either link the application against special third-party
+ libraries (or for thread-safe/reentrant functions possibly against an
+ existing \f(CWlibc_r\fR of the platform vendor). For an asynchronous DNS
+ resolver library use the GNU \fBadns\fR package from Ian Jackson ( see
+ http://www.gnu.org/software/adns/adns.html ).
+ .SH "HISTORY"
+ The \fBPth\fR library was designed and implemented between February and
+ July 1999 by \fIRalf S. Engelschall\fR after evaluating numerous (mostly
+ preemptive) thread libraries and after intensive discussions with
+ \fIPeter Simons\fR, \fIMartin Kraemer\fR, \fILars Eilebrecht\fR and \fIRalph
+ Babel\fR related to an experimental (matrix based) non-preemptive \*(C+
+ scheduler class written by \fIPeter Simons\fR.
+ .PP
+ \fBPth\fR was then implemented in order to combine the \fInon-preemptive\fR
+ approach of multithreading (which provides better portability and
+ performance) with an API similar to the popular one found in \fBPthread\fR
+ libraries (which provides easy programming).
+ .PP
+ So the essential idea of the non-preemptive approach was taken over from
+ \fIPeter Simons\fR scheduler. The priority based scheduling algorithm was
+ suggested by \fIMartin Kraemer\fR. Some code inspiration also came from
+ an experimental threading library (\fBrsthreads\fR) written by \fIRobert
+ S. Thau\fR for an ancient internal test version of the Apache webserver.
+ The concept and API of message ports was borrowed from AmigaOS\*(R' \fBExec\fR
+ subsystem. The concept and idea for the flexible event mechanism came
+ from \fIPaul Vixie\fR's \fBeventlib\fR (which can be found as a part of
+ \fBBIND\fR v8).
+ .SH "BUG REPORTS AND SUPPORT"
+ If you think you have found a bug in \fBPth\fR, you should send a report as
+ complete as possible to \fIbug-pth@gnu.org\fR. If you can, please try to
+ fix the problem and include a patch, made with \*(L'\f(CWdiff -u3\fR\*(R', in your
+ report. Always, at least, include a reasonable amount of description in
+ your report to allow the author to deterministically reproduce the bug.
+ .PP
+ For further support you additionally can subscribe to the
+ \fIpth-users@gnu.org\fR mailing list by sending an Email to
+ \fIpth-users-request@gnu.org\fR with `\f(CWsubscribe pth-users\fR\*(R' (or
+ `\f(CWsubscribe pth-users\fR \fIaddress\fR\*(R' if you want to subscribe
+ from a particular Email \fIaddress\fR) in the body. Then you can
+ discuss your issues with other \fBPth\fR users by sending messages to
+ \fIpth-users@gnu.org\fR. Currently (as of January 2000) you can reach about
+ 50 Pth users on this mailing list.
+ .SH "SEE ALSO"
+ .Sh "Related Web Locations"
+ `comp.programming.threads Newsgroup Archive\*(R',
+ http://www.deja.com/topics_if.xp?
+ search=topic&group=comp.programming.threads
+ .PP
+ `comp.programming.threads Frequently Asked Questions (F.A.Q.)\*(R',
+ http://www.lambdacs.com/newsgroup/\s-1FAQ\s0.html
+ .PP
+ `\fIMultithreading \- Definitions and Guidelines\fR\*(R',
+ Numeric Quest Inc 1998;
+ http://www.numeric-quest.com/lang/multi-frame.html
+ .PP
+ `\fIThe Single \s-1UNIX\s0 Specification, Version 2 \- Threads\fR\*(R',
+ The Open Group 1997;
+ http://www.opengroup.org/onlinepubs /007908799/xsh/threads.html
+ .PP
+ \s-1SMI\s0 Thread Resources,
+ Sun Microsystems Inc;
+ http://www.sun.com/workshop/threads/
+ .PP
+ Bibliography on threads and multithreading,
+ Torsten Amundsen;
+ http://liinwww.ira.uka.de/bibliography/Os/threads.html
+ .Sh "Related Books"
+ B. Nichols, D. Buttlar, J.P. Farrel:
+ `\fIPthreads Programming \- A \s-1POSIX\s0 Standard for Better Multiprocessing\fR\*(R',
+ O'Reilly 1996;
+ \s-1ISBN\s0 1-56592-115-1
+ .PP
+ B. Lewis, D. J. Berg:
+ `\fIMultithreaded Programming with Pthreads\fR\*(R',
+ Sun Microsystems Press, Prentice Hall 1998;
+ \s-1ISBN\s0 0-13-680729-1
+ .PP
+ B. Lewis, D. J. Berg:
+ `\fIThreads Primer \- A Guide To Multithreaded Programming\fR\*(R',
+ Prentice Hall 1996;
+ \s-1ISBN\s0 0-13-443698-9
+ .PP
+ S. J. Norton, M. D. Dipasquale:
+ `\fIThread Time \- The Multithreaded Programming Guide\fR\*(R',
+ Prentice Hall 1997;
+ \s-1ISBN\s0 0-13-190067-6
+ .PP
+ D. R. Butenhof:
+ `\fIProgramming with \s-1POSIX\s0 Threads\fR\*(R',
+ Addison Wesley 1997;
+ \s-1ISBN\s0 0-201-63392-2
+ .Sh "Related Manpages"
+ pth-\fIconfig\fR\|(1), \fIpthread\fR\|(3).
+ .PP
+ \fIgetcontext\fR\|(2), \fIsetcontext\fR\|(2), \fImakecontext\fR\|(2), \fIswapcontext\fR\|(2),
+ \fIsigstack\fR\|(2), \fIsigaltstack\fR\|(2), \fIsigaction\fR\|(2), \fIsigemptyset\fR\|(2), \fIsigaddset\fR\|(2),
+ \fIsigprocmask\fR\|(2), \fIsigsuspend\fR\|(2), \fIsigsetjmp\fR\|(3), \fIsiglongjmp\fR\|(3), \fIsetjmp\fR\|(3),
+ \fIlongjmp\fR\|(3), \fIselect\fR\|(2), \fIgettimeofday\fR\|(2).
+ .SH "AUTHOR"
+ .PP
+ .Vb 3
+ \& Ralf S. Engelschall
+ \& rse@engelschall.com
+ \& www.engelschall.com
+ .Ve
+ 
+ .rn }` ''
+ .IX Title "pth 3"
+ .IX Name "B<pth> - GNU Portable Threads"
+ 
+ .IX Header "NAME"
+ 
+ .IX Header "VERSION"
+ 
+ .IX Header "SYNOPSIS"
+ 
+ .IX Item "\fBGlobal Library Management\fR"
+ 
+ .IX Item "\fBThread Attribute Handling\fR"
+ 
+ .IX Item "\fBThread Control\fR"
+ 
+ .IX Item "\fBUtilities\fR"
+ 
+ .IX Item "\fBCancellation Management\fR"
+ 
+ .IX Item "\fBEvent Handling\fR"
+ 
+ .IX Item "\fBKey-Based Storage\fR"
+ 
+ .IX Item "\fBMessage Port Communication\fR"
+ 
+ .IX Item "\fBThread Cleanups\fR"
+ 
+ .IX Item "\fBProcess Forking\fR"
+ 
+ .IX Item "\fBSynchronization\fR"
+ 
+ .IX Item "\fBGeneralized \s-1POSIX\s0 Replacement \s-1API\s0\fR"
+ 
+ .IX Item "\fBStandard \s-1POSIX\s0 Replacement \s-1API\s0\fR"
+ 
+ .IX Header "DESCRIPTION"
+ 
+ .IX Subsection "Threading Background"
+ 
+ .IX Subsection "The World of Threading"
+ 
+ .IX Item "\fBo\fR \fBprocess\fR vs. \fBthread\fR"
+ 
+ .IX Item "\fBo\fR \fBkernel-space\fR vs. \fBuser-space\fR threading"
+ 
+ .IX Item "\fBo\fR \fBpreemtive\fR vs. \fBnon-preemtive\fR thread scheduling"
+ 
+ .IX Item "\fBo\fR \fBconcurrency\fR vs. \fBparallelism\fR"
+ 
+ .IX Item "\fBo\fR \fBresponsiveness\fR"
+ 
+ .IX Item "\fBo\fR \fBreentrant\fR, \fBthread-safe\fR and \fBasynchronous-safe\fR functions"
+ 
+ .IX Subsection "User-Space Threads"
+ 
+ .IX Item "\fB1.\fR"
+ 
+ .IX Item "\fB2.\fR"
+ 
+ .IX Subsection "The Compromise of Pth"
+ 
+ .IX Item "\fBo\fR"
+ 
+ .IX Item "\fBo\fR"
+ 
+ .IX Item "\fBo\fR"
+ 
+ .IX Item "\fBo\fR"
+ 
+ .IX Subsection "The life cycle of a thread"
+ 
+ .IX Header "APPLICATION PROGRAMMING INTERFACE (API)"
+ 
+ .IX Subsection "Global Library Management"
+ 
+ .IX Item "int \fBpth_init\fR(void);"
+ 
+ .IX Item "int \fBpth_kill\fR(void);"
+ 
+ .IX Item "long \fBpth_ctrl\fR(unsigned long \fIquery\fR, ...);"
+ 
+ .IX Item "\f(CWPTH_CTRL_GETTHREADS\fR"
+ 
+ .IX Item "\f(CWPTH_CTRL_GETAVLOAD\fR"
+ 
+ .IX Item "\f(CWPTH_CTRL_GETPRIO\fR"
+ 
+ .IX Item "\f(CWPTH_CTRL_GETNAME\fR"
+ 
+ .IX Item "\f(CWPTH_CTRL_DUMPSTATE\fR"
+ 
+ .IX Item "long \fBpth_version\fR(void);"
+ 
+ .IX Subsection "Thread Attribute Handling"
+ 
+ .IX Item "\f(CWPTH_ATTR_PRIO\fR (read-write) [\f(CWint\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_NAME\fR (read-write) [\f(CWchar *\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_JOINABLE\fR (read-write> [\f(CWint\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_CANCEL_STATE\fR (read-write) [\f(CWunsigned int\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_STACK_SIZE\fR (read-write) [\f(CWunsigned int\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_STACK_ADDR\fR (read-write) [\f(CWchar *\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_TIME_SPAWN\fR (read-only) [\f(CWpth_time_t\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_TIME_LAST\fR (read-only) [\f(CWpth_time_t\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_TIME_RAN\fR (read-only) [\f(CWpth_time_t\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_START_FUNC\fR (read-only) [\f(CWvoid *(*)(void *)\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_START_ARG\fR (read-only) [\f(CWvoid *\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_STATE\fR (read-only) [\f(CWpth_state_t\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_EVENTS\fR (read-only) [\f(CWpth_event_t\fR]"
+ 
+ .IX Item "\f(CWPTH_ATTR_BOUND\fR (read-only) [\f(CWint\fR]"
+ 
+ .IX Item "pth_attr_t \fBpth_attr_of\fR(pth_t \fItid\fR);"
+ 
+ .IX Item "pth_attr_t \fBpth_attr_new\fR(void);"
+ 
+ .IX Item "int \fBpth_attr_init\fR(pth_attr_t \fIattr\fR);"
+ 
+ .IX Item "int \fBpth_attr_set\fR(pth_attr_t \fIattr\fR, int \fIfield\fR, ...);"
+ 
+ .IX Item "int \fBpth_attr_get\fR(pth_attr_t \fIattr\fR, int \fIfield\fR, ...);"
+ 
+ .IX Item "int \fBpth_attr_destroy\fR(pth_attr_t \fIattr\fR);"
+ 
+ .IX Subsection "Thread Control"
+ 
+ .IX Item "pth_t \fBpth_spawn\fR(pth_attr_t \fIattr\fR, void *(*\fIentry\fR)(void *), void *\fIarg\fR);"
+ 
+ .IX Item "int \fBpth_once\fR(pth_once_t *\fIctrlvar\fR, void (*\fIfunc\fR)(void *), void *\fIarg\fR);"
+ 
+ .IX Item "pth_t \fBpth_self\fR(void);"
+ 
+ .IX Item "int \fBpth_suspend\fR(pth_t \fItid\fR);"
+ 
+ .IX Item "int \fBpth_resume\fR(pth_t \fItid\fR);"
+ 
+ .IX Item "int \fBpth_raise\fR(pth_t \fItid\fR, int \fIsig\fR)"
+ 
+ .IX Item "int \fBpth_yield\fR(pth_t \fItid\fR);"
+ 
+ .IX Item "int \fBpth_nap\fR(pth_time_t \fInaptime\fR);"
+ 
+ .IX Item "int \fBpth_wait\fR(pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_cancel\fR(pth_t \fItid\fR);"
+ 
+ .IX Item "int \fBpth_abort\fR(pth_t \fItid\fR);"
+ 
+ .IX Item "int \fBpth_join\fR(pth_t \fItid\fR, void **\fIvalue\fR);"
+ 
+ .IX Item "void \fBpth_exit\fR(void *\fIvalue\fR);"
+ 
+ .IX Subsection "Utilities"
+ 
+ .IX Item "int \fBpth_fdmode\fR(int \fIfd\fR, int \fImode\fR);"
+ 
+ .IX Item "pth_time_t \fBpth_time\fR(long \fIsec\fR, long \fIusec\fR);"
+ 
+ .IX Item "pth_time_t \fBpth_timeout\fR(long \fIsec\fR, long \fIusec\fR);"
+ 
+ .IX Item "Sfdisc_t *\fBpth_sfiodisc\fR(void);"
+ 
+ .IX Subsection "Cancellation Management"
+ 
+ .IX Item "void \fBpth_cancel_state\fR(int \fInewstate\fR, int *\fIoldstate\fR);"
+ 
+ .IX Item "void \fBpth_cancel_point\fR(void);"
+ 
+ .IX Subsection "Event Handling"
+ 
+ .IX Item "pth_event_t \fBpth_event\fR(unsigned long \fIspec\fR, ...);"
+ 
+ .IX Item "\f(CWPTH_EVENT_FD\fR"
+ 
+ .IX Item "\f(CWPTH_EVENT_SELECT\fR"
+ 
+ .IX Item "\f(CWPTH_EVENT_SIGS\fR"
+ 
+ .IX Item "\f(CWPTH_EVENT_TIME\fR"
+ 
+ .IX Item "\f(CWPTH_EVENT_MSG\fR"
+ 
+ .IX Item "\f(CWPTH_EVENT_TID\fR"
+ 
+ .IX Item "\f(CWPTH_EVENT_FUNC\fR"
+ 
+ .IX Item "unsigned long \fBpth_event_typeof\fR(pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_event_extract\fR(pth_event_t \fIev\fR, ...);"
+ 
+ .IX Item "pth_event_t \fBpth_event_concat\fR(pth_event_t \fIev\fR, ...);"
+ 
+ .IX Item "pth_event_t \fBpth_event_isolate\fR(pth_event_t \fIev\fR);"
+ 
+ .IX Item "pth_event_t \fBpth_event_walk\fR(pth_event_t \fIev\fR, int \fIdirection\fR);"
+ 
+ .IX Item "int \fBpth_event_occurred\fR(pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_event_free\fR(pth_event_t \fIev\fR, int \fImode\fR);"
+ 
+ .IX Subsection "Key-Based Storage"
+ 
+ .IX Item "int \fBpth_key_create\fR(pth_key_t *\fIkey\fR, void (*\fIfunc\fR)(void *));"
+ 
+ .IX Item "int \fBpth_key_delete\fR(pth_key_t \fIkey\fR);"
+ 
+ .IX Item "int \fBpth_key_setdata\fR(pth_key_t \fIkey\fR, const void *\fIvalue\fR);"
+ 
+ .IX Item "void *\fBpth_key_getdata\fR(pth_key_t \fIkey\fR);"
+ 
+ .IX Subsection "Message Port Communication"
+ 
+ .IX Item "pth_msgport_t \fBpth_msgport_create\fR(const char *\fIname\fR);"
+ 
+ .IX Item "void \fBpth_msgport_destroy\fR(pth_msgport_t \fImp\fR);"
+ 
+ .IX Item "pth_msgport_t \fBpth_msgport_find\fR(const char *\fIname\fR);"
+ 
+ .IX Item "int \fBpth_msgport_pending\fR(pth_msgport_t \fImp\fR);"
+ 
+ .IX Item "int \fBpth_msgport_put\fR(pth_msgport_t \fImp\fR, pth_message_t *\fIm\fR);"
+ 
+ .IX Item "pth_message_t *\fBpth_msgport_get\fR(pth_msgport_t \fImp\fR);"
+ 
+ .IX Item "int \fBpth_msgport_reply\fR(pth_message_t *\fIm\fR);"
+ 
+ .IX Subsection "Thread Cleanups"
+ 
+ .IX Item "int \fBpth_cleanup_push\fR(void (*\fIhandler\fR)(void *), void *\fIarg\fR);"
+ 
+ .IX Item "int \fBpth_cleanup_pop\fR(int \fIexecute\fR);"
+ 
+ .IX Subsection "Process Forking"
+ 
+ .IX Item "int \fBpth_atfork_push\fR(void (*\fIprepare\fR)(void *), void (*)(void *\fIparent\fR), void (*)(void *\fIchild\fR), void *\fIarg\fR);"
+ 
+ .IX Item "int \fBpth_atfork_pop\fR(void);"
+ 
+ .IX Item "pid_t \fBpth_fork\fR(void);"
+ 
+ .IX Subsection "Synchronization"
+ 
+ .IX Item "int \fBpth_mutex_init\fR(pth_mutex_t *\fImutex\fR);"
+ 
+ .IX Item "int \fBpth_mutex_acquire\fR(pth_mutex_t *\fImutex\fR, int \fItry\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_mutex_release\fR(pth_mutex_t *\fImutex\fR);"
+ 
+ .IX Item "int \fBpth_rwlock_init\fR(pth_rwlock_t *\fIrwlock\fR);"
+ 
+ .IX Item "int \fBpth_rwlock_acquire\fR(pth_rwlock_t *\fIrwlock\fR, int \fIop\fR, int \fItry\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_rwlock_release\fR(pth_rwlock_t *\fIrwlock\fR);"
+ 
+ .IX Item "int \fBpth_cond_init\fR(pth_cond_t *\fIcond\fR);"
+ 
+ .IX Item "int \fBpth_cond_await\fR(pth_cond_t *\fIcond\fR, pth_mutex_t *\fImutex\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_cond_notify\fR(pth_cond_t *\fIcond\fR, int \fIbroadcast\fR);"
+ 
+ .IX Item "int \fBpth_barrier_init\fR(pth_barrier_t *\fIbarrier\fR, int I<threshold);"
+ 
+ .IX Item "int \fBpth_barrier_reach\fR(pth_barrier_t *\fIbarrier\fR);"
+ 
+ .IX Subsection "Generalized \s-1POSIX\s0 Replacement \s-1API\s0"
+ 
+ .IX Item "int \fBpth_sigwait_ev\fR(const sigset_t *\fIset\fR, int *\fIsig\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_connect_ev\fR(int \fIs\fR, const struct sockaddr *\fIaddr\fR, socklen_t \fIaddrlen\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_accept_ev\fR(int \fIs\fR, struct sockaddr *\fIaddr\fR, socklen_t *\fIaddrlen\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_select_ev\fR(int \fInfd\fR, fd_set *\fIrfds\fR, fd_set *\fIwfds\fR, fd_set *\fIefds\fR, struct timeval *\fItimeout\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "int \fBpth_poll_ev\fR(struct pollfd *\fIfds\fR, unsigned int \fInfd\fR, int \fItimeout\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_read_ev\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_readv_ev\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_write_ev\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_writev_ev\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_recv_ev\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_recvfrom_ev\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, struct sockaddr *\fIfrom\fR, socklen_t *\fIfromlen\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_send_ev\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Item "ssize_t \fBpth_sendto_ev\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, const struct sockaddr *\fIto\fR, socklen_t \fItolen\fR, pth_event_t \fIev\fR);"
+ 
+ .IX Subsection "Standard \s-1POSIX\s0 Replacement \s-1API\s0"
+ 
+ .IX Item "int \fBpth_usleep\fR(unsigned int \fIusec\fR);"
+ 
+ .IX Item "unsigned int \fBpth_sleep\fR(unsigned int \fIsec\fR);"
+ 
+ .IX Item "pid_t \fBpth_waitpid\fR(pid_t \fIpid\fR, int *\fIstatus\fR, int \fIoptions\fR);"
+ 
+ .IX Item "int \fBpth_sigmask\fR(int \fIhow\fR, const sigset_t *\fIset\fR, sigset_t *\fIoset\fR)"
+ 
+ .IX Item "int \fBpth_sigwait\fR(const sigset_t *\fIset\fR, int *\fIsig\fR);"
+ 
+ .IX Item "int \fBpth_connect\fR(int \fIs\fR, const struct sockaddr *\fIaddr\fR, socklen_t \fIaddrlen\fR);"
+ 
+ .IX Item "int \fBpth_accept\fR(int \fIs\fR, struct sockaddr *\fIaddr\fR, socklen_t *\fIaddrlen\fR);"
+ 
+ .IX Item "int \fBpth_select\fR(int \fInfd\fR, fd_set *\fIrfds\fR, fd_set *\fIwfds\fR, fd_set *\fIefds\fR, struct timeval *\fItimeout\fR);"
+ 
+ .IX Item "int \fBpth_poll\fR(struct pollfd *\fIfds\fR, unsigned int \fInfd\fR, int \fItimeout\fR);"
+ 
+ .IX Item "ssize_t \fBpth_read\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR);"
+ 
+ .IX Item "ssize_t \fBpth_readv\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR);"
+ 
+ .IX Item "ssize_t \fBpth_write\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR);"
+ 
+ .IX Item "ssize_t \fBpth_writev\fR(int \fIfd\fR, const struct iovec *\fIiovec\fR, int \fIiovcnt\fR);"
+ 
+ .IX Item "ssize_t \fBpth_pread\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, off_t \fIoffset\fR);"
+ 
+ .IX Item "ssize_t \fBpth_pwrite\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, off_t \fIoffset\fR);"
+ 
+ .IX Item "ssize_t \fBpth_recv\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR);"
+ 
+ .IX Item "ssize_t \fBpth_recvfrom\fR(int \fIfd\fR, void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, struct sockaddr *\fIfrom\fR, socklen_t *\fIfromlen\fR);"
+ 
+ .IX Item "ssize_t \fBpth_send\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR);"
+ 
+ .IX Item "ssize_t \fBpth_sendto\fR(int \fIfd\fR, const void *\fIbuf\fR, size_t \fInbytes\fR, int \fIflags\fR, const struct sockaddr *\fIto\fR, socklen_t \fItolen\fR);"
+ 
+ .IX Header "EXAMPLE"
+ 
+ .IX Header "BUILD ENVIRONMENTS"
+ 
+ .IX Subsection "Manual Build Environment (Novice)"
+ 
+ .IX Subsection "Autoconf Build Environment (Advanced)"
+ 
+ .IX Subsection "Autoconf Build Environment with Local Copy of Pth (Expert)"
+ 
+ .IX Header "SYSTEM CALL WRAPPER FACILITY"
+ 
+ .IX Subsection "Soft System Call Mapping"
+ 
+ .IX Subsection "Hard System Call Mapping"
+ 
+ .IX Header "IMPLEMENTATION NOTES"
+ 
+ .IX Header "RESTRICTIONS"
+ 
+ .IX Header "HISTORY"
+ 
+ .IX Header "BUG REPORTS AND SUPPORT"
+ 
+ .IX Header "SEE ALSO"
+ 
+ .IX Subsection "Related Web Locations"
+ 
+ .IX Subsection "Related Books"
+ 
+ .IX Subsection "Related Manpages"
+ 
+ .IX Header "AUTHOR"
+ 


ossp-pkg/pth/pth_p.h.in -> 1.26

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,97 ----
+ /*
+ **  GNU Pth - The GNU Portable Threads
+ **  Copyright (c) 1999-2000 Ralf S. Engelschall <rse@engelschall.com>
+ **
+ **  This file is part of GNU Pth, a non-preemptive thread scheduling
+ **  library which can be found at http://www.gnu.org/software/pth/.
+ **
+ **  This library is free software; you can redistribute it and/or
+ **  modify it under the terms of the GNU Lesser General Public
+ **  License as published by the Free Software Foundation; either
+ **  version 2.1 of the License, or (at your option) any later version.
+ **
+ **  This library is distributed in the hope that it will be useful,
+ **  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ **  Lesser General Public License for more details.
+ **
+ **  You should have received a copy of the GNU Lesser General Public
+ **  License along with this library; if not, write to the Free Software
+ **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ **  USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
+ **
+ **  pth_p.h: Pth private API definitions
+ */
+ 
+ #ifndef _PTH_P_H_
+ #define _PTH_P_H_
+ 
+ /* mandatory system headers */
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <string.h>
+ #include <setjmp.h>
+ #include <signal.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <ctype.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/wait.h>
+ #include <sys/socket.h>
+ 
+ /* library version */
+ #define _PTH_VERS_C_AS_HEADER_
+ #include "pth_vers.c"
+ #undef  _PTH_VERS_C_AS_HEADER_
+ 
+ /* public API headers */
+ #define _PTH_PRIVATE
+ #include "pth.h"
+ #undef _PTH_PRIVATE
+ 
+ /* autoconf defines and macros */
+ #include "pth_acdef.h"
+ #include "pth_acmac.h"
+ 
+ /* optional system headers */
+ #ifdef HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #ifdef HAVE_NET_ERRNO_H
+ #include <net/errno.h>
+ #endif
+ 
+ /* dmalloc support */
+ #ifdef PTH_DMALLOC
+ #include <dmalloc.h>
+ #endif
+ 
+ /* non-blocking flags */
+ #ifdef  O_NONBLOCK
+ #define O_NONBLOCKING O_NONBLOCK
+ #else
+ #ifdef  O_NDELAY
+ #define O_NONBLOCKING O_NDELAY
+ #else
+ #ifdef  FNDELAY
+ #define O_NONBLOCKING FNDELAY
+ #else
+ #error "No O_NONBLOCK, O_NDELAY or FNDELAY flag available!"
+ #endif
+ #endif
+ #endif
+ 
+ /* compiler happyness: avoid ``empty compilation unit'' problem */
+ #define COMPILER_HAPPYNESS(name) \
+     int __##name##_unit = 0;
+ 
+ /* generated contents */
+ BEGIN_DECLARATION
+ ==#==
+ END_DECLARATION
+ 
+ #endif /* _PTH_P_H_ */
+ 


ossp-pkg/pth/pth_vers.c -> 1.132

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,46 ----
+ /*
+ **  pth_vers.c -- Version Information for GNU Pth (syntax: C/C++)
+ **  [automatically generated and maintained by GNU shtool]
+ */
+ 
+ #ifdef _PTH_VERS_C_AS_HEADER_
+ 
+ #ifndef _PTH_VERS_C_
+ #define _PTH_VERS_C_
+ 
+ #define PTH_INTERNAL_VERSION 0x104002
+ 
+ typedef struct {
+     const int   v_hex;
+     const char *v_short;
+     const char *v_long;
+     const char *v_tex;
+     const char *v_gnu;
+     const char *v_web;
+     const char *v_sccs;
+     const char *v_rcs;
+ } pth_internal_version_t;
+ 
+ extern pth_internal_version_t pth_internal_version;
+ 
+ #endif /* _PTH_VERS_C_ */
+ 
+ #else /* _PTH_VERS_C_AS_HEADER_ */
+ 
+ #define _PTH_VERS_C_AS_HEADER_
+ #include "pth_vers.c"
+ #undef  _PTH_VERS_C_AS_HEADER_
+ 
+ pth_internal_version_t pth_internal_version = {
+     0x104002,
+     "1.4a2",
+     "1.4a2 (01-Jul-2000)",
+     "This is GNU Pth, Version 1.4a2 (01-Jul-2000)",
+     "GNU Pth 1.4a2 (01-Jul-2000)",
+     "GNU Pth/1.4a2",
+     "@(#)GNU Pth 1.4a2 (01-Jul-2000)",
+     "$Id: GNU Pth 1.4a2 (01-Jul-2000) $"
+ };
+ 
+ #endif /* _PTH_VERS_C_AS_HEADER_ */
+ 


ossp-pkg/pth/pthread-config.1 -> 1.90

*** /dev/null    Sat Nov 23 01:38:59 2024
--- -    Sat Nov 23 01:39:07 2024
***************
*** 0 ****
--- 1,315 ----
+ .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-CONFIG 1 "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-config\fR \- Pth pthread library build utility
+ .SH "VERSION"
+ GNU Pth 1.4a2 (01-Jul-2000)
+ .SH "SYNOPSIS"
+ \fBpthread-config\fR
+ [\fB--help\fR]
+ [\fB--version\fR]
+ [\fB--all\fR]
+ [\fB--prefix\fR]
+ [\fB--exec-prefix\fR]
+ [\fB--bindir\fR]
+ [\fB--libdir\fR]
+ [\fB--includedir\fR]
+ [\fB--mandir\fR]
+ [\fB--cflags\fR]
+ [\fB--ldflags\fR]
+ [\fB--libs\fR]
+ .SH "DESCRIPTION"
+ The \fBpthread-config\fR program is a little helper utility for easy configuring
+ and building applications based on the pthread emulation API of the GNU
+ Portable Threads (pth) library.  It can be used to query the C compiler and
+ linker flags which are required to correctly compile and link the application
+ against the \fIpth\fR\|(3) library.
+ .SH "OPTIONS"
+ \fBpthread-config\fR accepts the following options:
+ .Ip "\fB--help\fR" 4
+ Prints the short usage information.
+ .Ip "\fB--version\fR" 4
+ Prints the version number and date of the installed \fIpth\fR\|(3) library.
+ .Ip "\fB--all\fR" 4
+ Forces the output of all flags, that is, including extra flags which are not
+ \fBPth\fR specific.
+ .Ip "\fB--prefix\fR" 4
+ Prints the installation prefix of architecture independent files
+ .Ip "\fB--exec-prefix\fR" 4
+ Prints the installation prefix of architecture dependent files.
+ .Ip "\fB--bindir\fR" 4
+ Prints the installation directory of binaries.
+ .Ip "\fB--libdir\fR" 4
+ Prints the installation directory of libraries.
+ .Ip "\fB--includedir\fR" 4
+ Prints the installation directory of include headers.
+ .Ip "\fB--mandir\fR" 4
+ Prints the installation directory of manual pages.
+ .Ip "\fB--cflags\fR" 4
+ Prints the C compiler flags which are needed to compile the \fIpth\fR\|(3)\-based
+ application. The output is usually added to the \f(CWCFLAGS\fR variable of the
+ applications \f(CWMakefile\fR.
+ .Ip "\fB--ldflags\fR" 4
+ Prints the linker flags (\f(CW-L\fR) which are needed to link the application with
+ the \fIpth\fR\|(3) library. The output is usually added to the \f(CWLDFLAGS\fR variable of
+ the applications \f(CWMakefile\fR.
+ .Ip "\fB--libs\fR" 4
+ Prints the library flags (\f(CW-l\fR) which are needed to link the application with
+ the \fIpth\fR\|(3) library. The output is usually added to the \f(CWLIBS\fR variable of the
+ applications \f(CWMakefile\fR.
+ .SH "EXAMPLE"
+ .PP
+ .Vb 4
+ \& CC      = cc
+ \& CFLAGS  = -O `pthread-config --cflags`
+ \& LDFLAGS = `pthread-config --ldflags`
+ \& LIBS    = -lm `pthread-config --libs`
+ .Ve
+ .Vb 5
+ \& all: foo
+ \& foo: foo.o
+ \&     $(CC) $(LDFLAGS) -o foo foo.o $(LIBS)
+ \& foo.o: foo.c
+ \&     $(CC) $(CFLAGS) -c foo.c
+ .Ve
+ .SH "SEE ALSO"
+ \fIpthread\fR\|(3), \fIcc\fR\|(1).
+ .SH "AUTHOR"
+ .PP
+ .Vb 3
+ \& Ralf S. Engelschall
+ \& rse@engelschall.com
+ \& www.engelschall.com
+ .Ve
+ 
+ .rn }` ''
+ .IX Title "PTHREAD-CONFIG 1"
+ .IX Name "B<pthread-config> - Pth pthread library build utility"
+ 
+ .IX Header "NAME"
+ 
+ .IX Header "VERSION"
+ 
+ .IX Header "SYNOPSIS"
+ 
+ .IX Header "DESCRIPTION"
+ 
+ .IX Header "OPTIONS"
+ 
+ .IX Item "\fB--help\fR"
+ 
+ .IX Item "\fB--version\fR"
+ 
+ .IX Item "\fB--all\fR"
+ 
+ .IX Item "\fB--prefix\fR"
+ 
+ .IX Item "\fB--exec-prefix\fR"
+ 
+ .IX Item "\fB--bindir\fR"
+ 
+ .IX Item "\fB--libdir\fR"
+ 
+ .IX Item "\fB--includedir\fR"
+ 
+ .IX Item "\fB--mandir\fR"
+ 
+ .IX Item "\fB--cflags\fR"
+ 
+ .IX Item "\fB--ldflags\fR"
+ 
+ .IX Item "\fB--libs\fR"
+ 
+ .IX Header "EXAMPLE"
+ 
+ .IX Header "SEE ALSO"
+ 
+ .IX Header "AUTHOR"
+ 


ossp-pkg/pth/pthread.3 -> 1.94

*** /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 &quot;atomically with respect to access by another
+ thread to the mutex and then the condition variable&quot;.
+ 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 &quot;atomically with respect to access by another
+ thread to the mutex and then the condition variable&quot;.
+ 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 &quot;locks&quot; a read-write
+ lock that is about to be &quot;unlocked&quot; 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 &quot;locks&quot; a read-write
+ lock that is about to be &quot;unlocked&quot; 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 &quot;locks&quot; a read-write
+ lock that is about to be &quot;unlocked&quot; 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 &quot;locks&quot; a read-write
+ lock that is about to be &quot;unlocked&quot; 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"
+ 

CVSTrac 2.0.1