summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorjruoho <jruoho@NetBSD.org>2010-07-07 15:30:32 +0000
committerjruoho <jruoho@NetBSD.org>2010-07-07 15:30:32 +0000
commitcf6053f7b6bc6aed12825cf64fc5376dea673b19 (patch)
treeb9cdd9c2feb8d4910b3a406398817aa014bb9655 /lib/libpthread
parentf4fe57bd3e5f63cbf7fc5fe9926358843e02c0d0 (diff)
Split pthread_attr_getinheritsched() and pthread_attr_setinheritsched() to a
separate page, and actually document these.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/Makefile6
-rw-r--r--lib/libpthread/pthread_attr.318
-rw-r--r--lib/libpthread/pthread_attr_getinheritsched.3112
3 files changed, 116 insertions, 20 deletions
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile
index 01d9672caa5..8c24c137265 100644
--- a/lib/libpthread/Makefile
+++ b/lib/libpthread/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.62 2010/07/07 13:04:20 jruoho Exp $
+# $NetBSD: Makefile,v 1.63 2010/07/07 15:30:32 jruoho Exp $
#
WARNS= 4
@@ -92,6 +92,7 @@ MAN+= affinity.3 pthread.3 \
pthread_attr_get_np.3 \
pthread_attr_getdetachstate.3 \
pthread_attr_getguardsize.3 \
+ pthread_attr_getinheritsched.3 \
pthread_attr_getname_np.3 \
pthread_attr_getscope.3 \
pthread_attr_getstack.3 \
@@ -123,8 +124,6 @@ MLINKS+= affinity.3 pthread_getaffinity_np.3
MLINKS+= pthread_attr.3 pthread_attr_init.3
MLINKS+= pthread_attr.3 pthread_attr_destroy.3
-MLINKS+= pthread_attr.3 pthread_attr_setinheritsched.3
-MLINKS+= pthread_attr.3 pthread_attr_getinheritsched.3
MLINKS+= pthread_attr.3 pthread_attr_setschedparam.3
MLINKS+= pthread_attr.3 pthread_attr_getschedparam.3
MLINKS+= pthread_attr.3 pthread_attr_setschedpolicy.3
@@ -132,6 +131,7 @@ MLINKS+= pthread_attr.3 pthread_attr_getschedpolicy.3
MLINKS+= pthread_attr_getdetachstate.3 pthread_attr_setdetachstate.3
MLINKS+= pthread_attr_getguardsize.3 pthread_attr_setguardsize.3
+MLINKS+= pthread_attr_getinheritsched.3 pthread_attr_setinheritsched.3
MLINKS+= pthread_attr_getscope.3 pthread_attr_setscope.3
MLINKS+= pthread_attr_getstack.3 pthread_attr_setstack.3 \
pthread_attr_getstack.3 pthread_attr_getstacksize.3 \
diff --git a/lib/libpthread/pthread_attr.3 b/lib/libpthread/pthread_attr.3
index efaf32ca2f4..66d4a2a1a2c 100644
--- a/lib/libpthread/pthread_attr.3
+++ b/lib/libpthread/pthread_attr.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_attr.3,v 1.15 2010/07/07 13:04:20 jruoho Exp $
+.\" $NetBSD: pthread_attr.3,v 1.16 2010/07/07 15:30:32 jruoho Exp $
.\"
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -59,8 +59,6 @@
.Sh NAME
.Nm pthread_attr_init ,
.Nm pthread_attr_destroy ,
-.Nm pthread_attr_setinheritsched ,
-.Nm pthread_attr_getinheritsched ,
.Nm pthread_attr_setschedparam ,
.Nm pthread_attr_getschedparam
.Nm pthread_attr_setschedpolicy ,
@@ -75,10 +73,6 @@
.Ft int
.Fn pthread_attr_destroy "pthread_attr_t *attr"
.Ft int
-.Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched"
-.Ft int
-.Fn pthread_attr_getinheritsched "const pthread_attr_t * restrict attr" "int * restrict inheritsched"
-.Ft int
.Fn pthread_attr_setschedparam "pthread_attr_t * restrict attr" "const struct sched_param * restrict param"
.Ft int
.Fn pthread_attr_getschedparam "const pthread_attr_t * restrict attr" "struct sched_param * restrict param"
@@ -132,14 +126,6 @@ The value specified by
is invalid.
.El
.Pp
-.Fn pthread_attr_setinheritsched
-may fail if:
-.Bl -tag -width Er
-.It Bq Er EINVAL
-Invalid value for
-.Fa attr .
-.El
-.Pp
.Fn pthread_attr_setschedparam
may fail if:
.Bl -tag -width Er
@@ -169,8 +155,6 @@ Invalid or unsupported value for
.Sh STANDARDS
.Fn pthread_attr_init ,
.Fn pthread_attr_destroy ,
-.Fn pthread_attr_setinheritsched ,
-.Fn pthread_attr_getinheritsched ,
.Fn pthread_attr_setschedparam ,
.Fn pthread_attr_setschedparam ,
and
diff --git a/lib/libpthread/pthread_attr_getinheritsched.3 b/lib/libpthread/pthread_attr_getinheritsched.3
new file mode 100644
index 00000000000..5aed6335caf
--- /dev/null
+++ b/lib/libpthread/pthread_attr_getinheritsched.3
@@ -0,0 +1,112 @@
+.\" $NetBSD: pthread_attr_getinheritsched.3,v 1.1 2010/07/07 15:30:32 jruoho Exp $
+.\"
+.\" Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd July 7, 2010
+.Dt PTHREAD_ATTR_GETINHERITEDSCHED 3
+.Os
+.Sh NAME
+.Nm pthread_attr_getinheritedsched
+.Nd get and set
+.Dq inheritsched
+attribute
+.Sh LIBRARY
+.Lb libpthread
+.Sh SYNOPSIS
+.In pthread.h
+.Ft int
+.Fn pthread_attr_getinheritsched \
+"const pthread_attr_t * restrict attr" "int * restrict inheritsched"
+.Ft int
+.Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched"
+.Sh DESCRIPTION
+The
+.Fn pthread_attr_getinheritsched
+and
+.Fn pthread_attr_setinheritsched
+functions get and set, respectively, the inherit scheduler attribute,
+.Fa inheritsched ,
+in the
+.Fa attr
+object.
+The
+.Fa inheritsched
+parameter specifies whether a tread created by using
+.Fa attr
+will obtain its scheduling attributes directly from
+.Fa attr
+or whether it will inherit these from the calling thread.
+.Pp
+Two values are possible for
+.Fa inheritsched :
+.Bl -tag -width PTHREAD_EXPLICIT_SCHED -offset indent
+.It Dv PTHREAD_INHERIT_SCHED
+The thread scheduling attributes will be
+inherited from the creating thread and the ones in
+.Fa attr
+are ignored.
+.It Dv PTHREAD_EXPLICIT_SCHED
+The thread scheduling attributes will be set to the corresponding values in
+.Fa attr .
+.El
+.Pp
+The following thread scheduling attributes are affected by
+.Fa inheritsched :
+.Bl -bullet -offset indent
+.It
+Scheduling policy; see
+.Xr pthread_attr_setschedpolicy 3 .
+.It
+Scheduling parameter; see
+.Xr pthread_attr_getschedparam 3 .
+.It
+Scheduling contention scope; see
+.Xr pthread_attr_getscope 3 .
+.El
+.Sh RETURN VALUES
+If successful, both functions return 0.
+Otherwise, an error number is returned to indicate the error.
+.Sh ERRORS
+No errors are defined for
+.Fn pthread_attr_getinheritsched .
+.Pp
+The
+.Fn pthread_attr_setinheritsched
+function may fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The value specified by
+.Fa inheritsched
+is invalid.
+.El
+.Sh SEE ALSO
+.Xr pthread_attr 3
+.Sh COMPATIBILITY
+The standard leaves it unspecified which (if any) is the default
+inherit scheduler attribute in a newly initialized attribute object.
+.Sh STANDARDS
+Both functions conform to
+.St -p1003.1-2008 .