int
sched_setparam(
pid_t pid
, const struct sched_param *param
)
int
sched_getparam(
pid_t pid
, struct sched_param *param
)
int
sched_setscheduler(
pid_t pid
, int policy
, const struct sched_param *param
)
int
sched_getscheduler(
pid_t pid
)
int
sched_get_priority_max(
int policy
)
int
sched_get_priority_min(
int policy
)
int
sched_rr_get_interval(
pid_t pid
, struct timespec *interval
)
int
sched_yield(
void
)
Available scheduling policies (classes) are:
SCHED_OTHER
SCHED_FIFO
SCHED_RR
The
struct
sched_param
contains at least one member:
sched_priority
pid
, param
)
pid
to
param
.
If the value of
pid
is equal to zero, then the calling process is used.
pid
, param
)
pid
into the structure
param
.
If the value of
pid
is equal to zero, then the calling process is used.
pid
, policy
, param
)
pid
.
If the value of
pid
is equal to zero, then the calling process is used.
pid
)
pid
.
If the value of
pid
is equal to zero, then the calling process is used.
policy
)
policy
.
policy
)
policy
.
pid
, interval
)
interval
of the process specified by
pid
.
If the value of
pid
is equal to zero, then the calling process is used.
The process must be running at
SCHED_RR
scheduling policy.
)
pid
, size
, cpuset
)
cpuset
for the process specified by
pid
.
At least one valid CPU must be set in the mask.
pid
, size
, cpuset
)
pid
into the
cpuset
.
),
sched_getparam(
),
sched_rr_get_interval(
),
and
sched_yield(
)
return 0 on success.
Otherwise, -1 is returned and
errno
is set to indicate the error.
sched_setscheduler()
returns the previously used scheduling policy on success.
Otherwise, -1 is returned and
errno
is set to indicate the error.
sched_getscheduler()
returns the scheduling policy on success.
Otherwise, -1 is returned and
errno
is set to indicate the error.
The
sched_get_priority_max()
and
sched_get_priority_min(
)
return the maximal/minimal priority value on success.
Otherwise, -1 is returned and
errno
is set to indicate the error.
The
sched_setaffinity_np()
and
sched_getaffinity_np(
)
return 0 on success.
Otherwise, -1 is returned and
errno
is set to indicate the error.
)
and
sched_setscheduler(
)
functions fail if:
EINVAL
]
EPERM
]
ESRCH
]
pid
,
and value of
pid
is not zero.
The
sched_getparam()
and
sched_getscheduler(
)
functions fail if:
EPERM
]
ESRCH
]
pid
,
and value of
pid
is not zero.
The
sched_get_priority_max()
and
sched_get_priority_min(
)
functions fail if:
EINVAL
]
The
sched_rr_get_interval()
function fails if:
ESRCH
]
pid
,
and value of
pid
is not zero.
)
and
sched_getaffinity_np(
)
functions.
)
and
sched_getaffinity_np(
),
are expected to conform the
IEEE Std 1003.1-2001 (``POSIX.1'')
standard.