Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ classcntl(2) — Digital UNIX 4.0d

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

class_scheduling(4)

runclass(1)

class_admin(8)

classcntl(2)  —  System Calls

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

opcodeIdentifies the type of operation (see below). 

arg1, arg2, and arg3
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. 

argumentsnone. 

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. 

argumentsnone. 

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

arg1User buffer into which the kernel data is copied.
arg2Number of bytes to copy.
arg3Unused.

CL_OP_ADD_TO_CLASS
Identify class members to the kernel so that their CPU usage is charged to their class.

arguments

arg1Class type, as in CL_TYPE_XXX (see class.h).
arg2Numeric value for member (gid, uid,
session id, pgrp id, or pid).
arg3Index 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

arg1Type as in CL_TYPE_XXX (see class.h).
arg2Numeric value for member (gid, uid,
session id, pgrp id, or pid).
arg3Unused.

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

arg1User buffer into which is copied into the kernel.
arg2Number of bytes to copy.
arg3idle_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

arg1The pid of the daemon.
arg2The interval, in seconds.
arg3Unused.

CL_OP_IS_ENABLED
Returns 1 if class scheduling is currently enabled, 0 otherwise.

argumentsnone

CL_OP_GET_PID_CLASS
Get the class index of a specified process id (pid).

arguments

arg1Pid of the target process.
arg2Address of the user data (integer) to receive
the class index.
arg3Unused

RESTRICTIONS

The caller must have root access rights. 

RETURN VALUES

Unless otherwise noted above, the classcntl returns a value of zero (0) on success.  Upon failure, the classcntl function returns -1 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. 

RELATED INFORMATION

class_scheduling(4), runclass(1),  class_admin(8). 
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026