2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
|
|
|
.\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
|
|
|
|
.\"
|
|
|
|
.\" This is free documentation; you can redistribute it and/or
|
|
|
|
.\" modify it under the terms of the GNU General Public License as
|
|
|
|
.\" published by the Free Software Foundation; either version 2 of
|
|
|
|
.\" the License, or (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\" The GNU General Public License's references to "object code"
|
|
|
|
.\" and "executables" are to be interpreted as the output of any
|
|
|
|
.\" document formatting or typesetting system, including
|
|
|
|
.\" intermediate and printed output.
|
|
|
|
.\"
|
|
|
|
.\" This manual 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 General Public License for more details.
|
|
|
|
.\"
|
|
|
|
.\" You should have received a copy of the GNU General Public
|
|
|
|
.\" License along with this manual; if not, write to the Free
|
|
|
|
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
|
|
|
|
.\" USA.
|
|
|
|
.\"
|
|
|
|
.\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
|
|
|
|
.\" First version written
|
|
|
|
.\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
|
|
|
|
.\" revision
|
2004-11-03 14:43:40 +00:00
|
|
|
.\" Modified 2004-05-27 by Michael Kerrisk <mtk-manpages@gmx.net>
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
2006-03-23 01:06:07 +00:00
|
|
|
.TH SCHED_SETPARAM 2 2006-03-23 "Linux 2.6.16" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
sched_setparam, sched_getparam \- set and get scheduling parameters
|
|
|
|
.SH SYNOPSIS
|
2006-03-23 01:06:07 +00:00
|
|
|
.nf
|
2004-11-03 13:51:07 +00:00
|
|
|
.B #include <sched.h>
|
|
|
|
.sp
|
2006-03-23 01:06:07 +00:00
|
|
|
\fBint sched_setparam(pid_t \fIpid\fB, const struct sched_param *\fIparam\fB);
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-03-23 01:06:07 +00:00
|
|
|
\fBint sched_getparam(pid_t \fIpid\fB, struct sched_param *\fIparam\fB);
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
|
|
|
\fBstruct sched_param {
|
2006-03-23 01:06:07 +00:00
|
|
|
...
|
|
|
|
int \fIsched_priority\fB;
|
|
|
|
...
|
2004-11-03 13:51:07 +00:00
|
|
|
};
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_setparam ()
|
2004-11-03 13:51:07 +00:00
|
|
|
sets the scheduling parameters associated with the scheduling policy
|
|
|
|
for the process identified by \fIpid\fR. If \fIpid\fR is zero, then
|
|
|
|
the parameters of the current process are set. The interpretation of
|
2006-03-23 01:06:07 +00:00
|
|
|
the parameter \fIparam\fR depends on the scheduling
|
|
|
|
policy of the process identified by
|
|
|
|
.IR pid .
|
|
|
|
See
|
|
|
|
.BR sched_setscheduler (2)
|
|
|
|
for a description of the scheduling policies supported under Linux.
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_getparam ()
|
2004-11-03 13:51:07 +00:00
|
|
|
retrieves the scheduling parameters for the
|
|
|
|
process identified by \fIpid\fR. If \fIpid\fR is zero, then the parameters
|
|
|
|
of the current process are retrieved.
|
|
|
|
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_setparam ()
|
2006-03-23 01:06:07 +00:00
|
|
|
checks the validity of \fIparam\fR for the scheduling policy of the
|
|
|
|
process. The parameter \fIparam->sched_priority\fR must lie within the
|
|
|
|
range given by \fBsched_get_priority_min\fR(2) and
|
|
|
|
\fBsched_get_priority_max\fR(2).
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2005-07-28 14:36:53 +00:00
|
|
|
For a discussion of the privileges and resource limits related to
|
|
|
|
scheduling priority and policy, see
|
|
|
|
.BR sched_setscheduler (2).
|
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
POSIX systems on which
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_setparam ()
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_getparam ()
|
2004-11-03 13:51:07 +00:00
|
|
|
are available define
|
|
|
|
.I _POSIX_PRIORITY_SCHEDULING
|
|
|
|
in <unistd.h>.
|
|
|
|
.SH "RETURN VALUE"
|
|
|
|
On success,
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_setparam ()
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_getparam ()
|
2004-11-03 13:51:07 +00:00
|
|
|
return 0.
|
2006-03-23 01:06:07 +00:00
|
|
|
On error, \-1 is returned, and
|
2004-11-03 13:51:07 +00:00
|
|
|
.I errno
|
|
|
|
is set appropriately.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
2006-03-23 01:06:07 +00:00
|
|
|
The parameter \fIparam\fR does not make sense for the current
|
2004-11-03 13:51:07 +00:00
|
|
|
scheduling policy.
|
|
|
|
.TP
|
|
|
|
.B EPERM
|
2005-07-28 14:36:53 +00:00
|
|
|
The calling process does not have appropriate privileges
|
|
|
|
(Linux: does not have the
|
|
|
|
.B CAP_SYS_NICE
|
|
|
|
capability).
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B ESRCH
|
|
|
|
The process whose ID is \fIpid\fR could not be found.
|
|
|
|
.SH "CONFORMING TO"
|
|
|
|
POSIX.1b (formerly POSIX.4)
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR getpriority (2),
|
|
|
|
.BR nice (2),
|
|
|
|
.BR sched_get_priority_max (2),
|
|
|
|
.BR sched_get_priority_min (2),
|
|
|
|
.BR sched_getaffinity (2),
|
|
|
|
.BR sched_getscheduler (2),
|
|
|
|
.BR sched_setaffinity (2),
|
|
|
|
.BR sched_setscheduler (2),
|
|
|
|
.BR setpriority (2),
|
|
|
|
.BR capabilities (7)
|
|
|
|
.PP
|
|
|
|
.I Programming for the real world \- POSIX.4
|
|
|
|
by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0
|
|
|
|
.br
|
|
|
|
.I IEEE Std 1003.1b-1993
|
|
|
|
(POSIX.1b standard)
|
|
|
|
.br
|
|
|
|
.I ISO/IEC 9945-1:1996
|