diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2010-11-07 13:29:22 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2010-11-07 13:29:22 +0000 |
commit | faa8b5e679ee0fac54c692d17e8a5e175e5f93d3 (patch) | |
tree | 5d0d6a283d1720f567b583be5d1a9c4285d4307e /lib/libpthread/man | |
parent | 3a26cb7fefc14941ce96f8da211d77b5cb75a8c4 (diff) |
Add sched_get_priority_{min,max}. tested in a bulk by landry@.
input and ok from phessler@ and guenther@
Diffstat (limited to 'lib/libpthread/man')
-rw-r--r-- | lib/libpthread/man/Makefile.inc | 5 | ||||
-rw-r--r-- | lib/libpthread/man/pthread_schedparam.3 | 16 | ||||
-rw-r--r-- | lib/libpthread/man/sched_prio.3 | 71 |
3 files changed, 85 insertions, 7 deletions
diff --git a/lib/libpthread/man/Makefile.inc b/lib/libpthread/man/Makefile.inc index 959b9b16264..7819c0f7435 100644 --- a/lib/libpthread/man/Makefile.inc +++ b/lib/libpthread/man/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.24 2010/04/12 01:54:23 tedu Exp $ +# $OpenBSD: Makefile.inc,v 1.25 2010/11/07 13:29:21 fgsch Exp $ # $FreeBSD: Makefile.inc,v 1.6 1999/08/28 00:03:02 peter Exp $ # POSIX thread man files @@ -59,6 +59,7 @@ MAN+= \ pthread_suspend_np.3 \ pthread_testcancel.3 \ pthread_yield.3 \ + sched_prio.3 \ sem_destroy.3 \ sem_getvalue.3 \ sem_init.3 \ @@ -103,6 +104,8 @@ MLINKS+=flockfile.3 funlockfile.3 \ pthread_testcancel.3 pthread_setcancelstate.3 \ pthread_testcancel.3 pthread_setcanceltype.3 \ pthread_getconcurrency.3 pthread_setconcurrency.3 \ + sched_prio.3 sched_get_priority_max.3 \ + sched_prio.3 sched_get_priority_min.3 \ sem_open.3 sem_close.3 \ sem_open.3 sem_unlink.3 \ sem_wait.3 sem_trywait.3 diff --git a/lib/libpthread/man/pthread_schedparam.3 b/lib/libpthread/man/pthread_schedparam.3 index f145b7e7c6e..1aa49349d4a 100644 --- a/lib/libpthread/man/pthread_schedparam.3 +++ b/lib/libpthread/man/pthread_schedparam.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_schedparam.3,v 1.2 2007/05/31 19:19:37 jmc Exp $ +.\" $OpenBSD: pthread_schedparam.3,v 1.3 2010/11/07 13:29:21 fgsch Exp $ .\" Copyright (C) 2000 Jason Evans <jasone@freebsd.org>. .\" All rights reserved. .\" @@ -27,7 +27,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/lib/libc_r/man/pthread_schedparam.3,v 1.4 2001/07/15 07:53:27 dd Exp $ -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: November 7 2010 $ .Dt PTHREAD_SCHEDPARAM 3 .Os .Sh NAME @@ -53,10 +53,11 @@ The scheduling policy for a thread can either be (round-robin). The thread priority (accessed via .Va param->sched_priority ) -must be at least -.Dv PTHREAD_MIN_PRIORITY -and no more than -.Dv PTHREAD_MAX_PRIORITY . +must be within the range returned by the +.Fn sched_get_priority_min +and +.Fn sched_get_priority_max +functions. .Sh RETURN VALUES If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. @@ -81,6 +82,9 @@ will fail if: Non-existent thread .Va thread . .El +.Sh SEE ALSO +.Xr sched_get_priority_max 3 , +.Xr sched_get_priority_min 3 .Sh STANDARDS .Fn pthread_setschedparam and diff --git a/lib/libpthread/man/sched_prio.3 b/lib/libpthread/man/sched_prio.3 new file mode 100644 index 00000000000..4b15fd94e6f --- /dev/null +++ b/lib/libpthread/man/sched_prio.3 @@ -0,0 +1,71 @@ +.\" $OpenBSD: sched_prio.3,v 1.1 2010/11/07 13:29:21 fgsch Exp $ +.\" +.\" Copyright (c) 2010 Federico G. Schwindt <fgsch@openbsd.org> +.\" +.\" Permission to use, copy, modify, and distribute this software for +.\" any purpose with or without fee is hereby granted, provided that +.\" the above copyright notice and this permission notice appear in all +.\" copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +.\" WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +.\" AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA +.\" OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +.\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +.\" PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: November 7 2010 $ +.Dt SCHED_PRIO 3 +.Os +.Sh NAME +.Nm sched_get_priority_max , +.Nm sched_get_priority_min +.Nd get priority limits +.Sh SYNOPSIS +.Fd #include <sched.h> +.Ft int +.Fn sched_get_priority_max "int policy" +.Ft int +.Fn sched_get_priority_min "int policy" +.Sh DESCRIPTION +The +.Fn sched_get_priority_max +and +.Fn sched_get_priority_min +functions return the maximum and minimum priority values, respectively, +for the scheduling policy specified by +.Fa policy . +.Pp +The scheduling policy for a thread can either be +.Dv SCHED_FIFO +(first in, first out), +.Dv SCHED_RR +(round-robin) or +.Dv SCHED_OTHER . +.Sh RETURN VALUES +Upon successful completion, +.Fn sched_get_priority_max +and +.Fn sched_get_priority_min +return the maximum and minimum priority values, respectively. +Otherwise, a value of -1 is returned and errno is set to indicate the error. +.Sh ERRORS +The +.Fn sched_get_priority_max +and +.Fn sched_get_priority_min +functions will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +Invalid value for +.Fa policy . +.Sh STANDARDS +.Fn sched_get_priority_max +and +.Fn sched_get_priority_min +conforms to +.St -p1003.1-2008 . +.Pp +This implementation does not support process scheduling. |