 |
Index for Section 2 |
|
 |
Alphabetical listing for C |
|
classcntl(2)
NAME
classcntl - manage kernel class scheduling properties.
SYNOPSIS
#include <sys/types.h>
#include <sys/class.h>
int classcntl(
int opcode,
int arg1,
int arg2,
int arg3 );
PARAMETERS
opcode
Identifies the type of operation (see below).
arg1, arg2, and arg3
These are opcode dependent and are described below.
DESCRIPTION
The classcntl function is used to control kernel class scheduler functions.
Opcode and Argument Descriptions
CL_OP_ENABLE
Informs the kernel that class scheduling is turned on. The kernel will
look for threads being class scheduled and charge time used against the
class. Once class scheduling has been enabled, it is necessary to tell
the kernel which class members to begin charging via the
CL_OP_ADD_TO_CLASS opcode.
There are no arguments.
CL_OP_DISABLE
Turn off class scheduling. All class members are reset to their
original state. If the kernel has been notified, via
CL_OP_DAEMON_ALIVE, that a class scheduler daemon has been started,
that daemon will be terminated.
There are no arguments.
CL_OP_GET_CLASS_LIST
Gets the class_list array from the kernel. The class_list array is a
list of MAX_NUM_CLASSES integers.
Arguments:
arg1
User buffer into which the kernel data is copied.
arg2
Number of bytes to copy.
arg3
Unused.
CL_OP_ADD_TO_CLASS
Identify class members to the kernel so that their CPU usage is charged
to their class.
Arguments:
arg1
Class type, as in CL_TYPE_& (see class.h).
arg2
Numeric value for member (gid, uid, session id, pgrp id, or pid).
arg3
Index into the class_list array that represents the class.
CL_OP_DEL_FROM_CLASS
Notify the kernel that a class member's CPU time is not to be charged.
Arguments:
arg1
Type as in CL_TYPE_& (see class.h).
arg2
Numeric value for member (gid, uid, session id, pgrp id, or pid).
arg3
Unused.
CL_OP_SET_CLASS_LIST
Sets the class_list array into the kernel. The class_list array is a
list of MAX_NUM_CLASSES integers.
Arguments:
arg1
User buffer into which is copied into the kernel.
arg2
Number of bytes to copy.
arg3
idle_enforce -- when set to 0, a class is allowed to exceed its CPU
percentage if the system would be otherwise idle. Else, a class is
forced to its CPU percentage even if the system has no other work.
CL_OP_DAEMON_ALIVE
Informs the kernel that a class_scheduler daemon is running and how
often it checks class CPU usage. Should the daemon fail to run in
twice the interval specified, the kernel will disable class scheduling.
Arguments:
arg1
The pid of the daemon.
arg2
The interval, in seconds.
arg3
Unused.
CL_OP_IS_ENABLED
Returns 1 if class scheduling is currently enabled, 0 otherwise.
There are no arguments.
CL_OP_GET_PID_CLASS
Get the class index of a specified process id (pid).
Arguments:
arg1
Pid of the target process.
arg2
Address of the user data (integer) to receive the class index.
arg3
Unused.
RESTRICTIONS
The caller must have root access rights.
RETURN VALUES
Unless otherwise noted above, the classcntl returns a value of zero (0) on
success. The classcntl function returns -1 upon failure and sets errno to
indicate the error.
ERRORS
The classcntl function fails under the following conditions:
[EPERM]
The Caller does not have super user privileges.
[EACCESS]
Access denied -- class scheduling not enabled.
SEE ALSO
class_scheduling(4), runclass(1), class_admin(8)