IOPRIO_GET(2) BSD System Calls Manual IOPRIO_GET(2)NAME
ioprio_get, ioprio_set — get/set the I/O priority
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/resource.h>
int
ioprio_get(int which, int who);
int
ioprio_set(int which, int who, int prio);
DESCRIPTION
The ioprio_get() and ioprio_set() functions get and set the I/O scheduler
priority of a process, process group or all processes of a user.
The which argument specifies what type of resource's priority is to be
modified. It can have the following values (as defined in
<sys/resource.h>):
PRIO_PROCESS A single process
PRIO_PGRP A process group
PRIO_USER All processes of a user
The who argument specifies, depending on the which argument, either the
process ID (if which is PRIO_PROCESS), the process group ID (if which is
PRIO_PGRP), or the user ID (if which is PRIO_USER). A value of 0 speci‐
fies either the current process, the current process group, or the cur‐
rent user.
For the ioprio_set() function, the prio argument specifies the priority
to be set. It can range from 1 to 10, with higher numbers indicating a
higher priority.
RETURN VALUES
The ioprio_get() and ioprio_set() functions return the value 0 if suc‐
cessful; otherwise the value -1 is returned and the global variable errno
is set to indicate the error.
ERRORS
The ioprio_get() function will fail if:
[EINVAL] An invalid value was specified for the which argument
[ESRCH] No corresponding process, process group or user could be found
for the ID specified in who
The ioprio_set() function will fail if:
[EACCES] The caller isn't allowed to access the I/O priority
[EINVAL] An invalid value was specified for the which argument
[EPERM] The caller doesn't own the specified process or processes
[ESRCH] No corresponding process, process group or user could be found
for the ID specified in who
SEE ALSOioprio(1)HISTORY
The ioprio_get() and ioprio_set() function calls first appeared in
DragonFly 2.7.
AUTHORS
Alex Hornung
BSD May 12, 2010 BSD