2010-07-09 02:19:26 +04:00
|
|
|
.\" $NetBSD: pthread_attr_getschedparam.3,v 1.2 2010/07/08 22:19:26 jruoho Exp $
|
2010-07-07 20:04:19 +04:00
|
|
|
.\"
|
|
|
|
.\" 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_GETSCHEDPARAM 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm pthread_attr_getschedparam
|
2010-07-09 02:19:26 +04:00
|
|
|
.Nd get and set scheduling attributes
|
2010-07-07 20:04:19 +04:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libpthread
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In pthread.h
|
|
|
|
.Ft int
|
|
|
|
.Fn pthread_attr_getschedparam \
|
|
|
|
"const pthread_attr_t * restrict attr" "struct sched_param * restrict param"
|
|
|
|
.Ft int
|
|
|
|
.Fn pthread_attr_setschedparam \
|
|
|
|
"pthread_attr_t *attr" "const struct sched_param *param"
|
2010-07-09 02:19:26 +04:00
|
|
|
.Ft int
|
|
|
|
.Fn pthread_attr_getschedpolicy \
|
|
|
|
"const pthread_attr_t * restrict attr" "int * restrict policy"
|
|
|
|
.Ft int
|
|
|
|
.Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy"
|
2010-07-07 20:04:19 +04:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Fn pthread_attr_getschedparam
|
|
|
|
and
|
|
|
|
.Fn pthread_attr_setschedparam
|
|
|
|
functions obtain and set the scheduling parameter attribute in the
|
|
|
|
.Fa attr
|
|
|
|
object.
|
|
|
|
The
|
|
|
|
.Vt sched_param
|
|
|
|
structure is defined in
|
|
|
|
.In sched.h .
|
|
|
|
At minimum this structure contains only a single member,
|
|
|
|
.Vt sched_priority .
|
|
|
|
Refer to
|
|
|
|
.Xr pthread_schedparam 3
|
|
|
|
and
|
|
|
|
.Xr sched 3
|
|
|
|
for additional details.
|
2010-07-09 02:19:26 +04:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn pthread_attr_getschedpolicy
|
|
|
|
and
|
|
|
|
.Fn pthread_attr_setschedpolicy
|
|
|
|
functions get and set the scheduling policy attribute,
|
|
|
|
.Fa policy ,
|
|
|
|
in the
|
|
|
|
.Fa attr
|
|
|
|
object.
|
|
|
|
The supported values of
|
|
|
|
.Fa policy
|
|
|
|
are the same ones listed in
|
|
|
|
.Xr pthread_schedparam 3 .
|
2010-07-07 20:04:19 +04:00
|
|
|
.Sh RETURN VALUES
|
2010-07-09 02:19:26 +04:00
|
|
|
If successful, all described functions return 0.
|
2010-07-07 20:04:19 +04:00
|
|
|
Otherwise, an error number is returned to indicate the error.
|
|
|
|
.Sh ERRORS
|
2010-07-09 02:19:26 +04:00
|
|
|
The
|
|
|
|
.Fn pthread_attr_getschedparam
|
|
|
|
function may fail if:
|
2010-07-07 20:04:19 +04:00
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er EINVAL
|
|
|
|
An invalid parameter was specified.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn pthread_attr_setschedparam
|
2010-07-09 02:19:26 +04:00
|
|
|
function may fail if:
|
2010-07-07 20:04:19 +04:00
|
|
|
.Bl -tag -width Er
|
2010-07-09 02:19:26 +04:00
|
|
|
.It Bq Er EINVAL
|
|
|
|
An invalid parameter was specified.
|
2010-07-07 20:04:19 +04:00
|
|
|
.It Bq Er ENOMEM
|
|
|
|
There was insufficient memory.
|
|
|
|
.El
|
2010-07-09 02:19:26 +04:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn pthread_attr_setschedpolicy
|
|
|
|
function may fail if:
|
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er ENOMEM
|
|
|
|
There was insufficient memory.
|
|
|
|
.It Bq Er ENOTSUP
|
|
|
|
An unsupported
|
|
|
|
.Fa policy
|
|
|
|
was specified.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
No errors are defined for
|
|
|
|
.Fn pthread_attr_getschedpolicy .
|
2010-07-07 20:04:19 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr pthread_attr 3 ,
|
|
|
|
.Xr pthread_schedparam 3 ,
|
|
|
|
.Xr sched 3
|
|
|
|
.Sh STANDARDS
|
2010-07-09 02:19:26 +04:00
|
|
|
These functions conform to
|
2010-07-07 20:04:19 +04:00
|
|
|
.St -p1003.1-2008 .
|