USCHED_SET(2) BSD System Calls Manual USCHED_SET(2)NAMEusched_set — setting up a proc's usched
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/types.h>
#include <sys/usched.h>
int
usched_set(pid_t pid, int cmd, void *data, int bytes);
DESCRIPTION
The usched_set() function is used to perform several user scheduler
tasks. These tasks include: setting the user scheduler, assigning an LWP
to a specific CPU, adding a CPU to the available CPUs for an LWP, and
removing a CPU from the list of available CPUs for an LWP. The
usched_set() function requires superuser privileges for all commands
except USCHED_GET_CPU.
The cmd argument specifies the action for usched_set() to take.
USCHED_SET_SCHEDULER sets the user scheduler where data is a char * that
contains the name of the user scheduler. USCHED_SET_CPU assigns the LWP
to the cpuid pointed to by data. USCHED_GET_CPU copies the LWP's CPU ID
to the cpuid pointed to by data. USCHED_ADD_CPU adds the cpuid specified
by data to the list of available CPUs for the LWP. USCHED_DEL_CPU
removes the cpuid specified by data from the list of available CPUs for
the LWP.
RETURN VALUES
Upon successful completion, the value 0 is returned; otherwise the
value -1 is returned and the global variable errno is set to indicate the
error.
ERRORS
The function will fail if:
[EINVAL] The user scheduler to set is not in the list of avail‐
able user schedulers. The bytes argument is not the
correct size (int) for a cpuid. The specified cpuid
is not set in smp_active_mask. Cmd contains an
unknown value.
[EFBIG] The specified cpuid is not a valid cpuid for the sys‐
tem.
[EPERM] Deleting the specified cpuid leaves the LWP without a
CPU to run on.
HISTORY
The usched_set() function call was added in DragonFly 1.9.
AUTHORSUsched_set() was written by Matt Dillon. This manual page was written by
Joe Talbott.
BSD February 26, 2009 BSD