57 lines
1.7 KiB
Groff
57 lines
1.7 KiB
Groff
'\"macro stdmacro
|
|
.Op c p a
|
|
.TH sched_getscheduler 2
|
|
.SH NAME
|
|
\f4sched_getscheduler\fP \- get the scheduling policy of a process
|
|
.SH C SYNOPSIS
|
|
.nf
|
|
\f3#include <sched.h>\f1
|
|
.sp .6v
|
|
\f4int sched_getscheduler (pid_t \f2pid\fP);\f1
|
|
.fi
|
|
.SH DESCRIPTION
|
|
The \f4sched_getscheduler\fP system call is used to get the scheduling
|
|
policy of the process specified by \f2pid\fP. If \f2pid\fP is set to zero,
|
|
then the scheduling policy of the caller is returned.
|
|
.P
|
|
A process may obtain the scheduling policy of itself and any process
|
|
sharing the same real user ID [see \f4getuid\fP(2)]. To obtain
|
|
the scheduling policy of an unrelated process, the calling process must
|
|
have superuser permissions.
|
|
.P
|
|
If \f2pid\fP refers to a POSIX thread process [see \f4pthreads\fP(3P)]
|
|
then this call retrieves the scheduling policy
|
|
that is shared by process scope threads.
|
|
.P
|
|
\f4sched_getscheduler\fP will fail if one or more of the following are true:
|
|
.TP 15
|
|
[EINVAL]
|
|
The process specified by \f2pid\fP is not executing with a
|
|
scheduling policy.
|
|
.TP
|
|
[EPERM]
|
|
The calling process attempted to obtain the scheduling policy of an
|
|
unrelated process and the caller does not have superuser permissions.
|
|
.TP
|
|
[ESRCH]
|
|
The process specified by \f2pid\fP does not exist.
|
|
.SH SEE ALSO
|
|
sched_setparam(2),
|
|
sched_getparam(2),
|
|
sched_setscheduler(2),
|
|
sched_yield(2),
|
|
sched_get_priority_max(2),
|
|
sched_get_priority_min(2),
|
|
sched_rr_get_interval(2),
|
|
sproc(2),
|
|
fork(2),
|
|
getuid(2),
|
|
pthreads(5)
|
|
.SH DIAGNOSTICS
|
|
Upon successful completion, one of the following scheduling
|
|
policies is returned: SCHED_FIFO, SCHED_RR, SCHED_TS. These
|
|
scheduling policies are described in \f4sched_setscheduler\fP(2).
|
|
.P
|
|
Otherwise, a value of -1 is returned and \f4errno\fP is set to indicate
|
|
the error.
|