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
|
2007-09-20 06:52:22 +00:00
|
|
|
.\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
2007-05-30 05:36:26 +00:00
|
|
|
.TH SCHED_SETPARAM 2 2006-03-23 "Linux" "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
|
2007-07-16 18:57:34 +00:00
|
|
|
.BI "int sched_setparam(pid_t " pid ", const struct sched_param *" param );
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2007-07-16 18:57:34 +00:00
|
|
|
.BI "int sched_getparam(pid_t " pid ", struct sched_param *" param );
|
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
|
2007-07-18 20:24:30 +00:00
|
|
|
for the process identified by \fIpid\fP.
|
|
|
|
If \fIpid\fP is zero, then
|
2007-12-27 16:06:35 +00:00
|
|
|
the parameters of the calling process are set.
|
2007-04-12 22:42:49 +00:00
|
|
|
The interpretation of
|
2008-07-10 20:53:08 +00:00
|
|
|
the argument \fIparam\fP depends on the scheduling
|
2006-03-23 01:06:07 +00:00
|
|
|
policy of the process identified by
|
2007-04-12 22:42:49 +00:00
|
|
|
.IR pid .
|
|
|
|
See
|
2006-03-23 01:06:07 +00:00
|
|
|
.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 ()
|
2007-04-12 22:42:49 +00:00
|
|
|
retrieves the scheduling parameters for the
|
2007-07-18 20:24:30 +00:00
|
|
|
process identified by \fIpid\fP.
|
|
|
|
If \fIpid\fP is zero, then the parameters
|
2007-12-27 16:06:35 +00:00
|
|
|
of the calling process are retrieved.
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR sched_setparam ()
|
2007-07-18 20:24:30 +00:00
|
|
|
checks the validity of \fIparam\fP for the scheduling policy of the
|
2007-04-12 22:42:49 +00:00
|
|
|
process.
|
2008-07-10 20:56:42 +00:00
|
|
|
The value \fIparam\->sched_priority\fP must lie within the
|
2007-05-12 09:06:04 +00:00
|
|
|
range given by
|
|
|
|
.BR sched_get_priority_min (2)
|
|
|
|
and
|
|
|
|
.BR sched_get_priority_max (2).
|
2004-11-03 13:51:07 +00:00
|
|
|
|
2007-04-12 22:42:49 +00:00
|
|
|
For a discussion of the privileges and resource limits related to
|
2005-07-28 14:36:53 +00:00
|
|
|
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
|
2007-06-20 22:09:10 +00:00
|
|
|
.B _POSIX_PRIORITY_SCHEDULING
|
2007-06-20 21:53:34 +00:00
|
|
|
in \fI<unistd.h>\fP.
|
2004-11-03 13:51:07 +00:00
|
|
|
.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
|
2008-07-10 20:53:08 +00:00
|
|
|
The argument \fIparam\fP 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
|
2007-07-18 20:24:30 +00:00
|
|
|
The process whose ID is \fIpid\fP could not be found.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
2006-08-03 13:57:17 +00:00
|
|
|
POSIX.1-2001.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "SEE ALSO"
|
sched_get_priority_max.2, sched_setparam.2, sched_setaffinity.2, sched_setscheduler.2, timer_create.2, malloc.3, pthread_attr_init.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_getattr_np.3, pthread_cancel.3, pthread_create.3, pthread_setschedparam.3, pthread_setschedprio.3, aio.7, time.7: Global ffix: disable justification and hyphenation in SEE ALSO
For a better visual result, disable justification and hyphenation
in SEE ALSO where page names are long.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-09-25 04:34:17 +00:00
|
|
|
.ad l
|
|
|
|
.nh
|
2004-11-03 13:51:07 +00:00
|
|
|
.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
|
arch_prctl.2, fcntl.2, flock.2, get_robust_list.2, getpriority.2, ioprio_set.2, migrate_pages.2, mmap.2, mremap.2, msync.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, select.2, socket.2, subpage_prot.2, unshare.2, btree.3, dbopen.3, dl_iterate_phdr.3, dlopen.3, getnameinfo.3, hash.3, lockf.3, netlink.3, recno.3, rpc.3, xdr.3, cciss.4, console_ioctl.4, hpsa.4, initrd.4, msr.4, rtc.4, st.4, hosts.5, services.5, tzfile.5, aio.7, arp.7, capabilities.7, cpuset.7, feature_test_macros.7, futex.7, inotify.7, ip.7, ipv6.7, iso_8859-16.7, iso_8859-2.7, koi8-r.7, math_error.7, netlink.7, packet.7, pthreads.7, raw.7, spufs.7, udplite.7, uri.7, x25.7: Global fix: Various consistency fixes for SEE ALSO
Coauthored-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-09-24 07:53:22 +00:00
|
|
|
by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0.
|