.\" 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 .\" First version written .\" 1996-04-10 Markus Kuhn .\" revision .\" Modified 2004-05-27 by Michael Kerrisk .\" .TH SCHED_SETPARAM 2 2006-03-23 "Linux" "Linux Programmer's Manual" .SH NAME sched_setparam, sched_getparam \- set and get scheduling parameters .SH SYNOPSIS .nf .B #include .sp .BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param ); .sp .BI "int sched_getparam(pid_t " pid ", struct sched_param *" param ); .sp \fBstruct sched_param { ... int \fIsched_priority\fB; ... }; .fi .SH DESCRIPTION .BR sched_setparam () sets the scheduling parameters associated with the scheduling policy for the process identified by \fIpid\fP. If \fIpid\fP is zero, then the parameters of the calling process are set. The interpretation of the argument \fIparam\fP 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. .BR sched_getparam () retrieves the scheduling parameters for the process identified by \fIpid\fP. If \fIpid\fP is zero, then the parameters of the calling process are retrieved. .BR sched_setparam () checks the validity of \fIparam\fP for the scheduling policy of the process. The value \fIparam\->sched_priority\fP must lie within the range given by .BR sched_get_priority_min (2) and .BR sched_get_priority_max (2). For a discussion of the privileges and resource limits related to scheduling priority and policy, see .BR sched_setscheduler (2). POSIX systems on which .BR sched_setparam () and .BR sched_getparam () are available define .B _POSIX_PRIORITY_SCHEDULING in \fI\fP. .SH "RETURN VALUE" On success, .BR sched_setparam () and .BR sched_getparam () return 0. On error, \-1 is returned, and .I errno is set appropriately. .SH ERRORS .TP .B EINVAL The argument \fIparam\fP does not make sense for the current scheduling policy. .TP .B EPERM The calling process does not have appropriate privileges (Linux: does not have the .B CAP_SYS_NICE capability). .TP .B ESRCH The process whose ID is \fIpid\fP could not be found. .SH "CONFORMING TO" POSIX.1-2001. .SH "SEE ALSO" .ad l .nh .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. .SH COLOPHON This page is part of release 3.44 of the Linux .I man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.