Movatterモバイル変換


[0]ホーム

URL:


Skip Navigation Links
Exit Print View
Link to oracle.comman pages section 2: System Calls    Oracle Solaris 11 Information Library
Oracle Technology Network
Library
PDF
Print View
Feedback
search filter icon
search icon
 Search Scope:

Document Information

Preface

Introduction

System Calls

access(2)

acct(2)

acl(2)

adjtime(2)

alarm(2)

brk(2)

chdir(2)

chmod(2)

chown(2)

chroot(2)

close(2)

creat(2)

dup(2)

exec(2)

execl(2)

execle(2)

execlp(2)

execv(2)

execve(2)

execvex(2)

execvp(2)

_Exit(2)

_exit(2)

exit(2)

faccessat(2)

facl(2)

fchdir(2)

fchmod(2)

fchmodat(2)

fchown(2)

fchownat(2)

fchroot(2)

fcntl(2)

fexecve(2)

fgetlabel(2)

fork1(2)

fork(2)

forkall(2)

forkallx(2)

forkx(2)

fpathconf(2)

fstat(2)

fstatat(2)

fstatvfs(2)

futimens(2)

futimesat(2)

getacct(2)

getcontext(2)

getdents(2)

getegid(2)

geteuid(2)

getgid(2)

getgroups(2)

getisax(2)

getitimer(2)

getlabel(2)

getmsg(2)

getpflags(2)

getpgid(2)

getpgrp(2)

getpid(2)

getpmsg(2)

getppid(2)

getppriv(2)

getprojid(2)

getrctl(2)

getrlimit(2)

getsid(2)

gettaskid(2)

getuid(2)

getustack(2)

ioctl(2)

issetugid(2)

kill(2)

lchown(2)

link(2)

linkat(2)

llseek(2)

lseek(2)

lstat(2)

_lwp_cond_broadcast(2)

_lwp_cond_reltimedwait(2)

_lwp_cond_signal(2)

_lwp_cond_timedwait(2)

_lwp_cond_wait(2)

_lwp_continue(2)

_lwp_info(2)

_lwp_kill(2)

_lwp_mutex_lock(2)

_lwp_mutex_trylock(2)

_lwp_mutex_unlock(2)

_lwp_self(2)

_lwp_sema_init(2)

_lwp_sema_post(2)

_lwp_sema_trywait(2)

_lwp_sema_wait(2)

_lwp_suspend(2)

memcntl(2)

meminfo(2)

mincore(2)

mkdir(2)

mkdirat(2)

mknod(2)

mknodat(2)

mmap(2)

mmapobj(2)

mount(2)

mprotect(2)

msgctl(2)

msgget(2)

msgids(2)

msgrcv(2)

msgsnap(2)

msgsnd(2)

munmap(2)

nice(2)

ntp_adjtime(2)

ntp_gettime(2)

open(2)

openat(2)

pathconf(2)

pause(2)

pcsample(2)

pipe(2)

poll(2)

p_online(2)

ppoll(2)

pread(2)

priocntl(2)

priocntlset(2)

processor_bind(2)

processor_info(2)

profil(2)

pset_assign(2)

pset_bind(2)

pset_create(2)

pset_destroy(2)

pset_getattr(2)

pset_info(2)

pset_list(2)

pset_setattr(2)

putacct(2)

putmsg(2)

putpmsg(2)

pwrite(2)

read(2)

readlink(2)

readlinkat(2)

readv(2)

rename(2)

renameat(2)

resolvepath(2)

rmdir(2)

sbrk(2)

semctl(2)

semget(2)

semids(2)

semop(2)

semtimedop(2)

setcontext(2)

setegid(2)

seteuid(2)

setgid(2)

setgroups(2)

setitimer(2)

setpflags(2)

setpgid(2)

setpgrp(2)

setppriv(2)

setrctl(2)

setregid(2)

setreuid(2)

setrlimit(2)

setsid(2)

settaskid(2)

setuid(2)

setustack(2)

shmadv(2)

shmat(2)

shmctl(2)

shmdt(2)

shmget(2)

shmids(2)

shmop(2)

sigaction(2)

sigaltstack(2)

sigpending(2)

sigprocmask(2)

sigsend(2)

sigsendset(2)

sigsuspend(2)

sigwait(2)

__sparc_utrap_install(2)

stat(2)

statvfs(2)

stime(2)

swapctl(2)

symlink(2)

symlinkat(2)

sync(2)

sysfs(2)

sysinfo(2)

time(2)

times(2)

uadmin(2)

ulimit(2)

umask(2)

umount(2)

umount2(2)

uname(2)

unlink(2)

unlinkat(2)

ustat(2)

utime(2)

utimensat(2)

utimes(2)

uucopy(2)

vfork(2)

vforkx(2)

vhangup(2)

waitid(2)

wracct(2)

write(2)

writev(2)

yield(2)

priocntl

- process scheduler control

Synopsis

#include <sys/types.h>#include <sys/priocntl.h>#include <sys/rtpriocntl.h>#include <sys/tspriocntl.h>#include <sys/iapriocntl.h>#include <sys/fsspriocntl.h>#include <sys/fxpriocntl.h>longpriocntl(idtype_tidtype,id_tid,intcmd,/*arg */ ...);

Description

Thepriocntl() function provides for control over the scheduling of an activelight weight process (LWP).

LWPs fall into distinct classes with a separate scheduling policy applied toeach class. The classes currently supported are the realtime class, the time-sharingclass, the fair-share class, and the fixed-priority class. The characteristics of theseclasses are described under the corresponding headings below.

The class attribute of an LWP is inherited across thefork(2) functionand theexec(2) family of functions. Thepriocntl() function can be usedto dynamically change the class and other scheduling parameters associated with arunning LWP or set of LWPs given the appropriate permissions as explainedbelow.

In the default configuration, a runnable realtime LWP runs before any otherLWP. Therefore, inappropriate use of realtime LWP can have a dramatic negativeimpact on system performance.

Thepriocntl() function provides an interface for specifying a process, set ofprocesses, or an LWP to which the function applies. Thepriocntlset(2) functionprovides the same functions aspriocntl(), but allows a more general interfacefor specifying the set of LWPs to which the function is toapply.

Forpriocntl(), theidtype andid arguments are used together to specifythe set of LWPs. The interpretation ofid depends on the valueofidtype. The possible values foridtype and corresponding interpretations ofidare as follows:

P_ALL

Thepriocntl() function applies to all existing LWPs. The value ofid is ignored. The permission restrictions described below still apply.

P_CID

Theid argument is a class ID (returned by thepriocntl()PC_GETCID command as explained below). Thepriocntl() function applies to all LWPs in the specified class.

P_GID

Theid argument is a group ID. Thepriocntl() function applies to all LWPs with this effective group ID.

P_LWPID

Theid argument is an LWP ID. Thepriocntl function applies to the LWP with the specified ID within the calling process.

P_PGID

Theid argument is a process group ID. Thepriocntl() function applies to all LWPs currently associated with processes in the specified process group.

P_PID

Theid argument is a process ID specifying a single process. Thepriocntl() function applies to all LWPs currently associated with the specified process.

P_PPID

Theid argument is a parent process ID. Thepriocntl() function applies to all LWPs currently associated with processes with the specified parent process ID.

P_PROJID

Theid argument is a project ID. Thepriocntl() function applies to all LWPs with this project ID.

P_SID

Theid argument is a session ID. Thepriocntl() function applies to all LWPs currently associated with processes in the specified session.

P_TASKID

Theid argument is a task ID. Thepriocntl() function applies to all LWPs currently associated with processes in the specified task.

P_UID

Theid argument is a user ID. Thepriocntl() function applies to all LWPs with this effective user ID.

P_ZONEID

Theid argument is a zone ID. Thepriocntl() function applies to all LWPs with this zone ID.

P_CTID

Theid argument is a process contract ID. Thepriocntl() function applies to all LWPs with this process contract ID.

Anid value ofP_MYID can be used in conjunction with theidtype value to specify the LWP ID, parent process ID, process groupID, session ID, task ID, class ID, user ID, group ID, projectID, zone ID, or process contract ID of the calling LWP.

To change the scheduling parameters of an LWP (using thePC_SETPARMS orPC_SETXPARMS command as explained below) , the real or effective user IDof the LWP callingpriocntl() must match the real or the callingLWP must have sufficient privileges. These are the minimum permission requirements enforced forall classes. An individual class might impose additional permissions requirements when settingLWPs to that class and/or when setting class-specific scheduling parameters.

Two special scheduling classes,SYS andSDC, exist for the purpose ofscheduling the execution of certain special system processes (such as the swapperprocess). It is not possible to change the class of any LWPtoSYS orSDC. In addition, any processes in theSYS ofSDCclasses that are included in a specified set of processes are disregardedbypriocntl(). For example, anidtype ofP_UID and anidvalue of 0 would specify all processes with a user ID of 0except processes in theSYS andSDC classes and (if changing theparameters usingPC_SETPARMS orPC_SETXPARMS) theinit(1M) process.

Theinit process is a special case. For apriocntl() call tochange the class or other scheduling parameters of theinit process (processID 1), it must be the only process specified byidtype andid. Theinit process can be assigned to any class configured on thesystem, but the time-sharing class is almost always the appropriate choice. (Otherchoices might be highly undesirable. See theOracle Solaris Administration: Common Tasks for more information.)

The data type and value ofarg are specific to the typeof command specified bycmd.

Apcinfo_t structure with the following members, defined in<sys/priocntl.h>, is usedby thePC_GETCID andPC_GETCLINFO commands.

id_t   pc_cid;                   /* Class id */char   pc_clname[PC_CLNMSZ];     /* Class name */int    pc_clinfo[PC_CLINFOSZ];   /* Class information */

Thepc_cid member is a class ID returned by thepriocntl()PC_GETCIDcommand.

Thepc_clname member is a buffer of sizePC_CLNMSZ, defined in<sys/priocntl.h>,used to hold the class name:RT for realtime,TS for time-sharing,IAfor interactive,FSS for fair-share, orFX for fixed-priority. Each string is null-terminated.

Thepc_clinfo member is a buffer of sizePC_CLINFOSZ, defined in<sys/priocntl.h>,used to return data describing the attributes of a specific class. Theformat of this data is class-specific and is described under the appropriate heading(REALTIME CLASS,TIME-SHARING CLASS,INTERACTIVE CLASS,FAIR-SHARE CLASS, orFIXED-PRIORITY CLASS) below.

Apcparms_t structure with the following members, defined in<sys/priocntl.h>, is usedby thePC_SETPARMS andPC_GETPARMS commands.

id_t  pc_cid;                   /* LWP class */int   pc_clparms[PC_CLPARMSZ];  /* Class-specific params */

Thepc_cid member is a class ID returned by thepriocntl()PC_GETCIDcommand. The special class IDPC_CLNULL can also be assigned topc_cidwhen using thePC_GETPARMS command as explained below.

Thepc_clparms buffer holds class-specific scheduling parameters. The format of this parameterdata for a particular class is described under the appropriate heading below.PC_CLPARMSZ is the length of thepc_clparms buffer and is defined in<sys/priocntl.h>.

ThePC_SETXPARMS andPC_GETXPARMS commands exploit thevarargs declaration ofpriocntl(). Theargument following the command code is a class name:RT for realtime,TS for time-sharing,IA for interactive,FSS for fair-share, orFX forfixed-priority. The parameters after the class name build a chain of(key, value) pairs, where the key determines the meaning of thevalue within the pair. When usingPC_GETXPARMS, the value associated with the keyis always a pointer to a scheduling parameter. In contrast, when usingPC_SETXPARMS the scheduling parameter is given as a direct value. Akey value of0 terminates the sequence and all further keys orvalues are ignored.

ThePC_SETXPARMS andPC_GETXPARMS commands are more flexible thanPC_SETPARMS andPC_GETPARMSand should replacePC_SETPARMS andPC_GETPARMS on a long-term basis.

COMMANDS

Availablepriocntl() commands are:

PC_ADMIN

This command provides functionality needed for the implementation of thedispadmin(1M) utility. It is not intended for general use by other applications.

PC_DONICE

Set or get nice value of the specified LWP(s) associated with the specified process(es). When this command is used with theidtype ofP_LWPID, it sets the nice value of the LWP. Thearg argument points to a structure of typepcnice_t. Thepc_val member specifies the nice value and thepc_op specifies the type of the operation.

Whenpc_op is set toPC_GETNICE,priocntl() sets thepc_val to the highest priority (lowest numerical value) pertaining to any of the specified LWPs.

Whenpc_op is set toPC_SETNICE,priocntl() sets the nice value of all LWPs in the specified set to the value specified inpc_val member ofpcnice_t structure.

Thepriocntl() function returns-1 witherrno set toEPERM if the calling LWP doesn't have appropriate permissions to set or get nice values for one or more of the target LWPs. Ifpriocntl() encounters an error other than permissions, it does not continue through the set of target LWPs but returns the error immediately.

PC_GETCID

Get class ID and class attributes for a specific class given the class name. Theidtype andid arguments are ignored. Ifarg is non-null, it points to a structure of typepcinfo_t. Thepc_clname buffer contains the name of the class whose attributes you are getting.

On success, the class ID is returned inpc_cid, the class attributes are returned in thepc_clinfo buffer, and thepriocntl() call returns the total number of classes configured in the system (including thesys class). If the class specified bypc_clname is invalid or is not currently configured, thepriocntl() call returns-1 witherrno set toEINVAL. The format of the attribute data returned for a given class is defined in the<sys/rtpriocntl.h>,<sys/tspriocntl.h>,<sys/iapriocntl.h>,<sys/fsspriocntl.h>, or<sys/fxpriocntl.h> header and described under the appropriate heading below.

Ifarg is a null pointer, no attribute data is returned but thepriocntl() call still returns the number of configured classes.

PC_GETCLINFO

Get class name and class attributes for a specific class given class ID. Theidtype andid arguments are ignored. Ifarg is non-null, it points to a structure of typepcinfo_t. Thepc_cid member is the class ID of the class whose attributes you are getting.

On success, the class name is returned in thepc_clname buffer, the class attributes are returned in thepc_clinfo buffer, and thepriocntl() call returns the total number of classes configured in the system (including thesys class). The format of the attribute data returned for a given class is defined in the<sys/rtpriocntl.h>,<sys/tspriocntl.h>,<sys/iapriocntl.h>,<sys/fsspriocntl.h>, or<sys/fxpriocntl.h> header and described under the appropriate heading below.

Ifarg is a null pointer, no attribute data is returned but thepriocntl() call still returns the number of configured classes.

PC_GETPARMS

Get the class and/or class-specific scheduling parameters of an LWP. Thearg member points to a structure of typepcparms_t.

Ifpc_cid specifies a configured class and a single LWP belonging to that class is specified by theidtype andid values or theprocset structure, then the scheduling parameters of that LWP are returned in thepc_clparms buffer. If the LWP specified does not exist or does not belong to the specified class, thepriocntl() call returns-1 witherrno set toESRCH.

Ifpc_cid specifies a configured class and a set of LWPs is specified, the scheduling parameters of one of the specified LWP belonging to the specified class are returned in thepc_clparms buffer and thepriocntl() call returns the process ID of the selected LWP. The criteria for selecting an LWP to return in this case is class-dependent. If none of the specified LWPs exist or none of them belong to the specified class, thepriocntl() call returns-1 witherrno set toESRCH.

Ifpc_cid isPC_CLNULL and a single LWP is specified, the class of the specified LWP is returned inpc_cid and its scheduling parameters are returned in thepc_clparms buffer.

PC_GETXPARMS

Get the class or class-specific scheduling parameters of an LWP. The class name (first argument afterPC_GETXPARMS) specifies the class and the (key, value) pair sequence contains a pointer to the class-specific parameters. The keys and the types of the class-specific parameter data are described below and can also be found in the class-specific headers<sys/rtpriocntl.h>,<sys/tspriocntl.h>,<sys/iapriocntl.h>,<sys/fsspriocntl.h>, and<sys/fxpriocntl.h>. If the specified class is a configured class and a single LWP belonging to that class is specified by theidtype andid values or theprocset structure, then the scheduling parameters of that LWP are returned in the given (key, value) pair buffers. If the LWP specified does not exist or does not belong to the specified class,priocntl() returns-1 anderrno is set toESRCH.

If the class name specifies a configured class and a set of LWPs is given, the scheduling parameters of one of the specified LWPs belonging to the specified class are returned and thepriocntl() call returns the process ID of the selected LWP. The criteria for selecting an LWP to return in this case is class-dependent. If none of the specified LWPs exist or none of them belong to the specified class,priocntl() returns-1 anderrno is set toESRCH.

If the class name is a null pointer, a single process or LWP is specified, and a (key, value) pair for a class name request is given,priocntl() fills the buffer pointed to by value with the class name of the specified process or LWP. The key for the class name request isPC_KY_CLNAME and the class name buffer should be declared as:

char   pc_clname[PC_CLNMSZ];     /* Class name */
PC_SETPARMS

Set the class and class-specific scheduling parameters of the specified LWP(s) associated with the specified process(es). When this command is used with theidtype of P_LWPID, it will set the class and class-specific scheduling parameters of the LWP. Thearg argument points to a structure of typepcparms_t. Thepc_cid member specifies the class you are setting and thepc_clparms buffer contains the class-specific parameters you are setting. The format of the class-specific parameter data is defined in the<sys/rtpriocntl.h>,<sys/tspriocntl.h>,<sys/iapriocntl.h>,<sys/fsspriocntl.h>, or<sys/fxpriocntl.h> header and described under the appropriate class heading below.

When setting parameters for a set of LWPs,priocntl() acts on the LWPs in the set in an implementation-specific order. Ifpriocntl() encounters an error for one or more of the target processes, it might or might not continue through the set of LWPs, depending on the nature of the error. If the error is related to permissions (EPERM),priocntl() continues through the LWP set, resetting the parameters for all target LWPs for which the calling LWP has appropriate permissions. Thepriocntl() function then returns-1 witherrno set toEPERM to indicate that the operation failed for one or more of the target LWPs. Ifpriocntl() encounters an error other than permissions, it does not continue through the set of target LWPs but returns the error immediately.

PC_SETXPARMS

Set the class and class-specific scheduling parameters of the specified LWP(s) associated with the specified process(es). When this command is used withP_LWPID asidtype, it will set the class and class-specific scheduling parameters of the LWP. The class name (first argument afterPC_SETXPARMS) specifies the class to be changed and the following (key, value) pair sequence contains the class-specific parameters to be changed. Only those (key,value) pairs whose scheduling behavior is to change must be specified. The keys and the types of the class-specific parameter data are described below and can also be found in the class-specific header files<sys/rtpriocntl.h>,<sys/tspriocntl.h>,<sys/iapriocntl.h>,<sys/fsspriocntl.h>, and<sys/fxpriocntl.h>.

When setting parameters for a set of LWPs,priocntl() acts on the LWPs in the set in an implementation-specific order. Ifpriocntl() encounters an error for one or more of the target processes, it might or might not continue through the set of LWPs, depending on the nature of the error. If the error is related to permissions (EPERM),priocntl() continues to reset the parameters for all target LWPs where the calling LWP has appropriate permissions. Thepriocntl() function returns-1 anderrno is set toEPERM when the operation failed for one or more of the target LWPs. All errors other thanEPERM result in an immediate termination ofpriocntl().

REALTIME CLASS

The realtime class provides a fixed priority preemptive scheduling policy for thoseLWPS requiring fast and deterministic response and absolute user/application control of schedulingpriorities. If the realtime class is configured in the system, it shouldhave exclusive control of the highest range of scheduling priorities on the system.This ensures that a runnable realtime LWP is given CPU service beforeany LWP belonging to any other class.

The realtime class has a range of realtime priority (rt_pri) values thatcan be assigned to an LWP within the class. Realtime priorities rangefrom 0 tox, where the value ofx is configurable andcan be determined for a specific installation by using thepriocntl()PC_GETCID orPC_GETCLINFO command.

The realtime scheduling policy is a fixed priority policy. The scheduling priorityof a realtime LWP is never changed except as the result ofan explicit request by the user/application to change thert_pri value ofthe LWP.

For an LWP in the realtime class, thert_pri value is, forall practical purposes, equivalent to the scheduling priority of the LWP. Thert_pri value completely determines the scheduling priority of a realtime LWP relativeto other LWPs within its class. Numerically higherrt_pri values represent higher priorities.Since the realtime class controls the highest range of scheduling priorities inthe system, it is guaranteed that the runnable realtime LWP with thehighestrt_pri value is always selected to run before any other LWPs inthe system.

In addition to providing control over priority,priocntl() provides for control overthe length of the time quantum allotted to the LWP in therealtime class. The time quantum value specifies the maximum amount of timean LWP can run assuming that it does not complete or enter aresource or event wait state (sleep). If another LWP becomes runnable ata higher priority, the currently running LWP might be preempted before receivingits full time quantum.

The realtime quantum signal can be used for the notification of runawayrealtime processes about the consumption of their time quantum. Those processes, whichare monitored by the realtime time quantum signal, receive the configured signalin the event of time quantum expiration. The default value (0) of thetime quantum signal will denote no signal delivery and a positive valuewill denote the delivery of the signal specified by the value. Therealtime quantum signal can be set with thepriocntl()PC_SETXPARMS command anddisplayed with thepriocntl()PC_GETXPARMS command as explained below.

The system's process scheduler keeps the runnable realtime LWPs on a setof scheduling queues. There is a separate queue for each configured realtimepriority and all realtime LWPs with a givenrt_pri value are kepttogether on the appropriate queue. The LWPs on a given queue are orderedin FIFO order (that is, the LWP at the front of thequeue has been waiting longest for service and receives the CPU first).Realtime LWPs that wake up after sleeping, LWPs that change to therealtime class from some other class, LWPs that have used their fulltime quantum, and runnable LWPs whose priority is reset bypriocntl() are allplaced at the back of the appropriate queue for their priority. AnLWP that is preempted by a higher priority LWP remains at thefront of the queue (with whatever time is remaining in its timequantum) and runs before any other LWP at this priority. Following afork(2)function call by a realtime LWP, the parent LWP continues to runwhile the child LWP (which inherits its parent'srt_pri value) is placed atthe back of the queue.

Artinfo_t structure with the following members, defined in<sys/rtpriocntl.h>, defines theformat used for the attribute data for the realtime class.

short    rt_maxpri;      /* Maximum realtime priority */

Thepriocntl()PC_GETCID andPC_GETCLINFO commands return realtime class attributes in thepc_clinfo buffer in this format.

Thert_maxpri member specifies the configured maximumrt_pri value for the realtimeclass. Ifrt_maxpri isx, the valid realtime priorities range from 0tox.

Artparms_t structure with the following members, defined in<sys/rtpriocntl.h>, defines theformat used to specify the realtime class-specific scheduling parameters of an LWP.

short    rt_pri;       /* Real-Time priority */uint_t   rt_tqsecs;    /* Seconds in time quantum */int      rt_tqnsecs;   /* Additional nanoseconds in quantum */

When using thepriocntl()PC_SETPARMS orPC_GETPARMS commands, ifpc_cid specifies therealtime class, the data in thepc_clparms buffer are in this format.

These commands can be used to set the realtime priority to thespecified value or get the currentrt_pri value. Setting thert_pri valueof an LWP that is currently running or runnable (not sleeping) causesthe LWP to be placed at the back of the scheduling queue forthe specified priority. The LWP is placed at the back of theappropriate queue regardless of whether the priority being set is different fromthe previousrt_pri value of the LWP. A running LWP can voluntarilyrelease the CPU and go to the back of the scheduling queue atthe same priority by resetting itsrt_pri value to its current realtimepriority value. To change the time quantum of an LWP without settingthe priority or affecting the LWP's position on the queue, thert_primember should be set to the special valueRT_NOCHANGE, defined in<sys/rtpriocntl.h>. SpecifyingRT_NOCHANGE when changing the class of an LWP to realtime from someother class results in the realtime priority being set to 0.

For thepriocntl()PC_GETPARMS command, ifpc_cid specifies the realtime class andmore than one realtime LWP is specified, the scheduling parameters of therealtime LWP with the highestrt_pri value among the specified LWPs are returnedand the LWP ID of this LWP is returned by thepriocntl()call. If there is more than one LWP sharing the highest priority,the one returned is implementation-dependent.

Thert_tqsecs andrt_tqnsecs members are used for getting or setting thetime quantum associated with an LWP or group of LWPs.rt_tqsecs isthe number of seconds in the time quantum andrt_tqnsecs is the numberof additional nanoseconds in the quantum. For example, settingrt_tqsecs to 2andrt_tqnsecs to 500,000,000 (decimal) would result in a time quantum oftwo and one-half seconds. Specifying a value of 1,000,000,000 or greater inthert_tqnsecs member results in an error return witherrno set toEINVAL. Although the resolution of thetq_nsecs member is very fine, thespecified time quantum length is rounded up by the system to thenext integral multiple of the system clock's resolution. The maximum time quantum thatcan be specified is implementation-specific and equal toINT_MAX1 ticks. TheINT_MAXvalue is defined in<limits.h>. Requesting a quantum greater than this maximum resultsin an error return witherrno set toERANGE, although infinite quantumscan be requested using a special value as explained below. Requesting atime quantum of 0 by setting bothrt_tqsecs andrt_tqnsecs to 0results in an error return witherrno set toEINVAL.

Thert_tqnsecs member can also be set to one of the followingspecial values defined in<sys/rtpriocntl.h>, in which case the value ofrt_tqsecsis ignored:

RT_TQINF

Set an infinite time quantum.

RT_TQDEF

Set the time quantum to the default for this priority (seert_dptbl(4)).

RT_NOCHANGE

Do not set the time quantum. This value is useful when you wish to change the realtime priority of an LWP without affecting the time quantum. Specifying this value when changing the class of an LWP to realtime from some other class is equivalent to specifyingRT_TQDEF.

When using thepriocntl()PC_SETXPARMS orPC_GETXPARMS commands, the first argument afterthe command code must be the class name of the realtime class(RT) . The next arguments are formed as (key, value) pairs, terminated bya0 key. The definition for the keys of the realtime classcan be found in<sys/rtpriocntl.h>. A repeated specification of the same keyresults in an error return anderrno set toEINVAL.

Key
Value Type
Description
RT_KY_PRI
pri_t
realtime priority
RT_KY_TQSECS
uint_t
secondsin time quantum
RT_KY_TQNSECS
int
nanoseconds in time quantum
RT_KY_TQSIG
int
realtime time quantum signal

When using thepriocntl()PC_GETXPARMS command, the value associated with the keyis always a pointer to a scheduling parameter of the value typeshown in the table above. In contrast, when using thepriocntl()PC_SETXPARMScommand, the scheduling parameter is given as a direct value.

Apriocntl()PC_SETXPARMS command with the class name (RT) and without afollowing (key, value) pair will set or reset all realtime scheduling parametersof the target process(es) to their default values. Changing the class ofan LWP to realtime from some other class causes the parameters to beset to their default values. The default realtime priority (RT_KY_PRI) is0.A default time quantum (RT_TQDEF) is assigned to each priority class (seert_dptbl(4)). The default realtime time quantum signal (RT_KY_TQSIG) is0.

The value associated withRT_KY_TQSECS is the number of seconds in thetime quantum. The value associated withRT_KY_TQNSECS is the number of nanosecondsin the quantum. Specifying a value of 1,000,000,000 or greater for thenumber of nanoseconds results in an error return anderrno is set toEINVAL. The specified time quantum is rounded up by the system tothe next integral multiple of the system clock's resolution. The maximum timequantum that can be specified is implementation-specific and equal toINT_MAX ticks,defined in<limits.h>. Requesting a quantum greater than this maximum results inan error return anderrno is set toERANGE. If seconds (RT_KY_TQSECS)but no nanoseconds (RT_KY_TQNSECS) are supplied, the number of nanoseconds is set to0. If nanoseconds (RT_KY_TQNSECS) but no seconds (RT_KY_TQSECS) are supplied, the number of seconds is set to0. A time quantum of0(seconds and nanoseconds are0) results in an error return witherrnoset toEINVAL. Special values forRT_KY_TQSECS areRT_TQINF andRT_TQDEF (asdescribed above). Thepriocntl() commandPC_SETXPARMS knows no special valueRT_NOCHANGE.

To change the class of an LWP to realtime from any otherclass, the LWP invokingpriocntl() must have sufficient privileges. To change thepriority or time quantum setting of a realtime LWP, the LWP invokingpriocntl() must have sufficient privileges or must itself be a realtime LWP whosereal or effective user ID matches the real of effective user IDof the target LWP.

The realtime priority and time quantum are inherited acrossfork(2) and theexec family of functions. When using the time quantum signal with a user-definedsignal handler across theexec functions, the new image must install anappropriate user-defined signal handler before the time quantum expires. Otherwise, unpredictable behaviormight result.

TIME-SHARING CLASS

The time-sharing scheduling policy provides for a fair and effective allocation ofthe CPU resource among LWPs with varying CPU consumption characteristics. The objectivesof the time-sharing policy are to provide good response time to interactiveLWPs and good throughput to CPU-bound jobs, while providing a degree of user/applicationcontrol over scheduling.

The time-sharing class has a range of time-sharing user priority (seets_upribelow) values that can be assigned to LWPs within the class. Ats_upri value of 0 is defined as the default base priority forthe time-sharing class. User priorities range from -x to +x where the valueofx is configurable and can be determined for a specific installationby using thepriocntl()PC_GETCID orPC_GETCLINFO command.

The purpose of the user priority is to provide some degree ofuser/application control over the scheduling of LWPs in the time-sharing class. Raisingor lowering thets_upri value of an LWP in the time-sharing classraises or lowers the scheduling priority of the LWP. It is not guaranteed,however, that an LWP with a higherts_upri value will run beforeone with a lowerts_upri value, since thets_upri value is justone factor used to determine the scheduling priority of a time-sharing LWP. Thesystem can dynamically adjust the internal scheduling priority of a time-sharing LWPbased on other factors such as recent CPU usage.

In addition to the system-wide limits on user priority (returned by thePC_GETCID andPC_GETCLINFO commands) there is a per LWP user priority limit(seets_uprilim below) specifying the maximumts_upri value that can be set fora given LWP. By default,ts_uprilim is 0.

Atsinfo_t structure with the following members, defined in<sys/tspriocntl.h>, defines theformat used for the attribute data for the time-sharing class.

short    ts_maxupri;     /* Limits of user priority range */

Thepriocntl()PC_GETCID andPC_GETCLINFO commands return time-sharing class attributes in thepc_clinfo buffer in this format.

Thets_maxupri member specifies the configured maximum user priority value for thetime-sharing class. Ifts_maxupri isx, the valid range for both userpriorities and user priority limits is from -x to +x.

Atsparms_t structure with the following members, defined in<sys/tspriocntl.h>, defines theformat used to specify the time-sharing class-specific scheduling parameters of an LWP.

short    ts_uprilim;     /* Time-Sharing user priority limit */short    ts_upri;        /* Time-Sharing user priority */

When using thepriocntl()PC_SETPARMS orPC_GETPARMS commands, ifpc_cid specifies thetime-sharing class, the data in thepc_clparms buffer is in this format.

For thepriocntl()PC_GETPARMS command, ifpc_cid specifies the time-sharing class andmore than one time-sharing LWP is specified, the scheduling parameters of thetime-sharing LWP with the highestts_upri value among the specified LWPs is returnedand the LWP ID of this LWP is returned by thepriocntl()call. If there is more than one LWP sharing the highest userpriority, the one returned is implementation-dependent.

Any time-sharing LWP can lower its ownts_uprilim (or that of anotherLWP with the same user ID). Only a time-sharing LWP with sufficientprivileges can raise ats_uprilim. When changing the class of an LWPto time-sharing from some other class, sufficient privileges are required to set theinitialts_uprilim to a value greater than 0. Attempts by an unprivilegedLWP to raise ats_uprilim or set an initialts_uprilim greater than0 fail with a return value of -1 anderrno set toEPERM.

Any time-sharing LWP can set its ownts_upri (or that of anotherLWP with the same user ID) to any value less than orequal to the LWP'sts_uprilim. Attempts to set thets_upri above thets_uprilim (and/or set thets_uprilim below thets_upri) result in thets_upri beingset equal to thets_uprilim.

Either of thets_uprilim orts_upri members can be set to thespecial valueTS_NOCHANGE, defined in<sys/tspriocntl.h>, to set one of the valueswithout affecting the other. SpecifyingTS_NOCHANGE for thets_upri when thets_uprilimis being set to a value below the currentts_upri causes thets_upri to be set equal to thets_uprilim being set. SpecifyingTS_NOCHANGE fora parameter when changing the class of an LWP to time-sharing (fromsome other class) causes the parameter to be set to a defaultvalue. The default value for thets_uprilim is0 and the defaultfor thets_upri is to set it equal to thets_uprilim that isbeing set.

When using thepriocntl()PC_SETXPARMS orPC_GETXPARMS commands, the first argument afterthe command code is the class name of the time-sharing class(TS) . The next arguments are formed as (key, value) pairs, terminated bya0 key. The definition for the keys of the time-sharing classcan be found in<sys/tspriocntl.h>. A repeated specification of the samekey results in an error return anderrno set toEINVAL.

Key
Value Type
Description
TS_KY_UPRILIM
pri_t
userpriority limit
TS_KY_UPRI
pri_t
user priority

When using thepriocntl()PC_GETXPARMS command, the value associated with the keyis always a pointer to a scheduling parameter of the value typein the table above. In contrast, when using thepriocntl()PC_SETXPARMS command, thescheduling parameter is given as a direct value.

Apriocntl()PC_SETXPARMS command with the class name (TS) and without afollowing (key, value) pair will set or reset all time-sharing scheduling parametersof the target process(es) to their default values. Changing the class of anLWP to time-sharing from some other class causes the parameters to beset to their default values. The default value for the user prioritylimit (TS_KY_UPRILIM) is0. The default value for the user priority (TS_KY_UPRI)is equal to the user priority limit (TS_KY_UPRILIM) that is being set.

Thepriocntl() commandPC_SETXPARMS knows no special valueTS_NOCHANGE.

The time-sharing user priority and user priority limit are inherited acrossfork()and theexec family of functions.

INTERACTIVE CLASS

The interactive scheduling policy is a variation on the time-sharing scheduling policy.All that can be said about the time-sharing scheduling policy is alsotrue for the interactive scheduling policy, with one addition: An LWP inthe interactive class with itsia_mode value set toIA_SET_INTERACTIVE has its time-sharingpriority boosted byIA_BOOST (10).

Aniainfo_t structure with the following members, defined in<sys/iapriocntl.h>, defines theformat used for the attribute data for the interactive class.

short    ia_maxupri;     /* Limits of user priority range */

Thepriocntl()PC_GETCID andPC_GETCLINFO commands return interactive class attributes in thepc_clinfo buffer in this format.

Theia_maxupri member specifies the configured maximum user priority value for theinteractive class. Ifia_maxupri isx, the valid range for both userpriorities and user priority limits is from -x to +x.

Aiaparms_t structure with the following members, defined in<sys/iapriocntl.h>, defines theformat used to specify the interactive class-specific scheduling parameters of an LWP.

short    ia_uprilim;     /* Interactive user priority limit */short    ia_upri;        /* Interactive user priority */int      ia_mode;        /* interactive on/off */

When using thepriocntl()PC_SETPARMS orPC_GETPARMS commands, ifpc_cid specifies theinteractive class, the data in thepc_clparms buffer is in this format.

For thepriocntl()PC_GETPARMS command, ifpc_cid specifies the interactive class andmore than one interactive LWP is specified, the scheduling parameters of theinteractive LWP with the highestia_upri value among the specified LWPs is returnedand the LWP ID of this LWP is returned by thepriocntl()call. If there is more than one LWP sharing the highest userpriority, the one returned is implementation-dependent.

All that is said above in the TIME-SHARING CLASS section concerning manipulationofts_uprilim andts_upri applies equally to manipulations ofia_uprilim andia_upriin the interactive class.

When using thePC_SETPARMS command, theia_mode member must be set toone of the valuesIA_SET_INTERACTIVE,IA_INTERACTIVE_OFF, orIA_NOCHANGE, defined in<sys/iapriocntl.h>, toset the interactive mode on or off or to make no changeto the interactive mode.

When using thepriocntl()PC_SETXPARMS orPC_GETXPARMS commands, the first argument afterthe command code is the class name of the interactive class (IA). The next arguments are formed as (key, value) pairs, terminated bya 0 key. The definition for the keys of the interactive class canbe found in<sys/iapriocntl.h>. A repeated specification of the same key resultsin an error return anderrno set toEINVAL.

Key
Value Type
Description
IA_KY_UPRILIM
pri_t
user priority limit
IA_KY_UPRI
pri_t
userpriority
IA_KY_MODE
int
interactive mode

When using thepriocntl()PC_GETXPARMS command, the value associated with the keyis always a pointer to a scheduling parameter of the value typein the table above. In contrast, when using thepriocntl()PC_SETXPARMS command, thescheduling parameter is given as a direct value.

Apriocntl()PC_SETXPARMS command with the class name (IA) and without afollowing (key, value) pair will set or reset all interactive scheduling parametersof the target process(es) to their default values. Changing the class ofan LWP to interactive from some other class causes the parameters to beset to their default values. The default value for the user prioritylimit (IA_KY_UPRILIM) is 0. The default value for the user priority (IA_KY_UPRI)is equal to the user priority limit (IA_KY_UPRILIM) that is being set. Thedefault value for the interactive mode (IA_KY_MODE) isIA_SET_INTERACTIVE.

Thepriocntl() commandPC_SETXPARMS knows no special valueIA_NOCHANGE.

The interactive user priority and user priority limit are inherited across forkand the exec family of functions.

FAIR-SHARE CLASS

The fair-share scheduling policy provides a fair allocation of CPU resources amongprojects, independent of the number of processes they contain. Projects are given“shares” to control their quota of CPU resources. SeeFSS(7) for moreinformation about how to configure shares.

The fair share class supports the notion of per-LWP user priority (seefss_upri below) values for compatibility with the time-sharing scheduling class. Anfss_uprivalue of 0 is defined as the default base priority for thefair-share class. User priorities range from -x to +x where the value ofx is configurable and can be determined for a specific installation byusing thepriocntl()PC_GETCID orPC_GETCLINFO command.

The purpose of the user priority is to provide some degree ofuser/application control over the scheduling of LWPs in the fair-share class. Raisingthefss_upri value of an LWP in the fair-share class tells thescheduler to give this LWP more CPU time slices, while lowering thefss_uprivalue tells the scheduler to give it less CPU slices. It isnot guaranteed, however, that an LWP with a higherfss_upri value willrun before one with a lowerfss_upri value. This is because thefss_upri value is just one factor used to determine the scheduling priority ofa fair-share LWP. The system can dynamically adjust the internal scheduling priorityof a fair-share LWP based on other factors such as recent CPUusage. The fair-share scheduler attempts to provide an evenly graded effect across thewhole range of user priority values.

User priority values do not interfere with project shares. That is, changinga user priority value of a process does not have any effecton its project CPU entitlement, which is based on the number ofshares it is allocated in comparison with other projects.

In addition to the system-wide limits on user priority (returned by thePC_GETCID andPC_GETCLINFO commands), there is a per-LWP user priority limit (seefss_uprilim below) that specifies the maximumfss_upri value that can be set fora given LWP. By default,fss_uprilim is 0.

Afssinfo_t structure with the following members, defined in<sys/fsspriocntl.h>, defines the format used for the attribute data for the fair-share class.

short    fss_maxupri;    /* Limits of user priority range */

Thepriocntl()PC_GETCID andPC_GETCLINFO commands return fair-share class attributes in thepc_clinfo buffer in this format.

fss_maxupri specifies the configured maximum user priority value for the fair-share class.Iffss_maxupri isx, the valid range for both user priorities anduser priority limits is from -x to +x.

Afssparms_t structure with the following members, defined in<sys/fsspriocntl.h>, defines theformat used to specify the fair-share class-specific scheduling parameters of an LWP.

short    fss_uprilim;   /* Fair-share user priority limit */short    fss_upri;      /* Fair-share user priority */

When using thepriocntl()PC_SETPARMS orPC_GETPARMS commands, ifpc_cid specifies thefair-share class, the data in thepc_clparms buffer is in this format.

For thepriocntl()PC_GETPARMS command, ifpc_cid specifies the fair-share class andmore than one fair-share LWP is specified, the scheduling parameters of the fair-share LWP with the highestfss_upri value among the specified LWPs isreturned and the LWP ID of this LWP is returned by thepriocntl() call. If there is more than one LWP sharing the highestuser priority, the one returned is implementation-dependent.

Any fair-share LWP can lower its ownfss_uprilim (or that of anotherLWP with the same user ID). Only a fair-share LWP with sufficientprivileges can raise anfss_uprilim. When changing the class of an LWPto fair-share from some other class, sufficient privileges are required to enter theFSS class or to set the initialfss_uprilim to a value greaterthan 0. Attempts by an unprivileged LWP to raise anfss_uprilim orset an initialfss_uprilim greater than 0 fail with a return value of-1 anderrno set toEPERM.

Any fair-share LWP can set its ownfss_upri (or that of anotherLWP with the same user ID) to any value less than orequal to the LWP'sfss_uprilim. Attempts to set thefss_upri above thefss_uprilim (and/or set thefss_uprilim below thefss_upri) result in thefss_upri beingset equal to thefss_uprilim.

Either of thefss_uprilim orfss_upri members can be set to thespecial valueFSS_NOCHANGE (defined in<sys/fsspriocntl.h>) to set one of the valueswithout affecting the other. SpecifyingFSS_NOCHANGE for thefss_upri when thefss_uprilimis being set to a value below the currentfss_upri causes thefss_upri to be set equal to thefss_uprilim being set. SpecifyingFSS_NOCHANGE fora parameter when changing the class of an LWP to fair-share (fromsome other class) causes the parameter to be set to a defaultvalue. The default value for thefss_uprilim is 0 and the defaultfor thefss_upri is to set it equal to thefss_uprilim which isbeing set.

The fair-share user priority and user priority limit are inherited acrossfork()and theexec family of functions.

FIXED-PRIORITY CLASS

The fixed-priority class provides a fixed-priority preemptive scheduling policy for those LWPsrequiring that the scheduling priorities do not get dynamically adjusted by thesystem and that the user/application have control of the scheduling priorities.

The fixed-priority class has a range of fixed-priority user priority (seefx_upribelow) values that can be assigned to LWPs within the class. Afx_upri value of 0 is defined as the default base priority forthe fixed-priority class. User priorities range from 0 tox where the valueofx is configurable and can be determined for a specific installationby using thepriocntl()PC_GETCID orPC_GETCLINFO command.

The purpose of the user priority is to provide user/application control overthe scheduling of processes in the fixed-priority class. For processes in thefixed-priority class, thefx_upri value is, for all practical purposes, equivalent tothe scheduling priority of the process. Thefx_upri value completely determines the schedulingpriority of a fixed-priority process relative to other processes within its class.Numerically higherfx_upri values represent higher priorities.

In addition to the system-wide limits on user priority (returned by thePC_GETCID andPC_GETCLINFO commands), there is a per-LWP user priority limit (seefx_uprilim below) that specifies the maximumfx_upri value that can be set fora given LWP. By default,fx_uprilim is 0.

A structure with the following member (defined in<sys/fxpriocntl.h>) defines the formatused for the attribute data for the fixed-priority class.

pri_t   fx_maxupri;      /* Maximum user priority */

Thepriocntl()PC_GETCID andPC_GETCLINFO commands return fixed-priority class attributes in thepc_clinfo buffer in this format.

Thefx_maxupri member specifies the configured maximum user priority value for thefixed-priority class. Iffx_maxupri isx, the valid range for both userpriorities and user priority limits is from 0 tox.

A structure with the following members (defined in<sys/fxpriocntl.h>) defines the formatused to specify the fixed-priority class-specific scheduling parameters of an LWP.

pri_t    fx_upri;     /* Fixed-priority user priority */pri_t    fx_uprilim;  /* Fixed-priority user priority limit */uint_t   fx_tqsecs;   /* seconds in time quantum */int      fx_tqnsecs;  /* additional nanosecs in time quant */

When using thepriocntl()PC_SETPARMS orPC_GETPARMS commands, ifpc_cid specifies thefixed-priority class, the data in thepc_clparms buffer is in this format.

For thepriocntl()PC_GETPARMS command, ifpc_cid specifies the fixed-priority class andmore than one fixed-priority LWP is specified, the scheduling parameters of thefixed-priority LWP with the highestfx_upri value among the specified LWPs is returnedand the LWP ID of this LWP is returned by thepriocntl()call. If there is more than one LWP sharing the highest userpriority, the one returned is implementation-dependent.

Any fixed-priority LWP can lower its ownfx_uprilim (or that of anotherLWP with the same user ID). Only a fixed-priority LWP with sufficientprivileges can raise afx_uprilim. When changing the class of an LWPto fixed-priority from some other class, sufficient privileges are required to set theinitialfx_uprilim to a value greater than 0. Attempts by an unprivilegedLWP to raise afx_uprilim or set an initialfx_uprilim greater than0 fail with a return value of -1 and errno set toEPERM.

Any fixed-priority LWP can set its ownfx_upri (or that of anotherLWP with the same user ID) to any value less than orequal to the LWP'sfx_uprilim. Attempts to set thefx_upri above thefx_uprilim (and/or set thefx_uprilim below thefx_upri) result in thefx_upri beingset equal to thefx_uprilim.

Either of thefx_uprilim orfx_upri members can be set to thespecial valueFX_NOCHANGE (defined in<sys/fxpriocntl.h>) to set one of the valueswithout affecting the other. SpecifyingFX_NOCHANGE for thefx_upri when thefx_uprilimis being set to a value below the currentfx_upri causes thefx_upri to be set equal to thefx_uprilim being set. SpecifyingFX_NOCHANGE fora parameter when changing the class of an LWP to fixed-priority (fromsome other class) causes the parameter to be set to a defaultvalue. The default value for thefx_uprilim is 0 and the defaultfor thefx_upri is to set it equal to thefx_uprilim thatis being set. The default for time quantum is dependent on thefx_upri and on the system configuration; seefx_dptbl(4).

Thefx_tqsecs andfx_tqnsecs members are used for getting or setting thetime quantum associated with an LWP or group of LWPs.fx_tqsecs isthe number of seconds in the time quantum andfx_tqnsecs is the numberof additional nanoseconds in the quantum. For example, settingfx_tqsecs to 2andfx_tqnsecs to 500,000,000 (decimal) would result in a time quantum oftwo and one-half seconds. Specifying a value of 1,000,000,000 or greater inthefx_tqnsecs member results in an error return witherrno set toEINVAL. Although the resolution of thetq_nsecs member is very fine, thespecified time quantum length is rounded up by the system to thenext integral multiple of the system clock's resolution. The maximum time quantum thatcan be specified is implementation-specific and equal toINT_MAX ticks (defined in<limits.h>). Requesting a quantum greater than this maximum results in an errorreturn witherrno set toERANGE, although infinite quantums can be requested usinga special value as explained below. Requesting a time quantum of 0(setting bothfx_tqsecs andfx_tqnsecs to 0) results in an error return witherrno set toEINVAL.

Thefx_tqnsecs member can also be set to one of the followingspecial values (defined in<sys/fxpriocntl.h>), in which case the value offx_tqsecsis ignored:

FX_TQINF

Set an infinite time quantum.

FX_TQDEF

Set the time quantum to the default for this priority (seefx_dptbl(4)).

FX_NOCHANGE

Do not set the time quantum. This value is useful in changing the user priority of an LWP without affecting the time quantum. Specifying this value when changing the class of an LWP to fixed-priority from some other class is equivalent to specifyingFX_TQDEF.

When using thepriocntl()PC_SETXPARMS orPC_GETXPARMS commands, the first argument afterthe command code must be the class name of the fixed-priority class(FX) . The next arguments are formed as (key, value) pairs, terminatedby a 0 key. The definition for the keys of the fixed-priority classcan be found in<sys/fxpriocntl.h>. A repeated specification of the same keyresults in an error return anderrno set toEINVAL.

Key
Value Type
Description
FX_KY_UPRILIM
pri_t
user prioritylimit
FX_KY_UPRI
pri_t
user priority
FX_KY_TQSECS
uint_t
seconds in time quantum
FX_KY_TQNSECS
int
nanoseconds in time quantum

When using thepriocntl()PC_GETXPARMS command, the value associated with the keyis always a pointer to a scheduling parameter of the value typeshown in the table above. In contrast, when using thepriocntl()PC_SETXPARMScommand, the scheduling parameter is given as a direct value.

Apriocntl()PC_SETXPARMS command with the class name (FX) and without afollowing (key, value) pair will set or reset all realtime scheduling parametersof the target process(es) to their default values. Changing the class ofan LWP to fixed-priority from some other class causes the parameters to beset to their default values. The default value for the user prioritylimit (FX_KY_UPRILIM) is 0. The default value for the user priority (FX_KY_UPRI)is equal to the user priority limit (FX_KY_UPRILIM) that is being set. Adefault time quantum (FX_TQDEF) is assigned to each priority class (seefx_dptbl(4)).

The value associated withFX_KY_TQSECS is the number of seconds in thetime quantum. The value associated withFX_KY_TQNSECS is the number of nanosecondsin the quantum. Specifying a value of 1,000,000,000 or greater for thenumber of nanoseconds results in an error return anderrno is set toEINVAL. The specified time quantum is rounded up by the system tothe next integral multiple of the system clock's resolution. The maximum timequantum that can be specified is implementation-specific and equal toINT_MAX ticks,defined in<limits.h>. Requesting a quantum greater than this maximum results inan error return anderrno is set toERANGE. If seconds (FX_KY_TQSECS)but no nanoseconds (FX_KY_TQNSECS) are supplied, the number of nanoseconds is set to0. If nanoseconds (FX_KY_TQNSECS) but no seconds (FX_KY_TQSECS) are supplied, the numberof seconds is set to 0. A time quantum of 0 (secondsand nanoseconds are 0) results in an error return witherrno set toEINVAL. Special values forFX_KY_TQSECS areFX_TQINF andFX_TQDEF (as described above).Thepriocntl() commandPC_SETXPARMS knows no special valueFX_NOCHANGE.

The fixed-priority user priority and user priority limit are inherited acrossfork(2)and theexec family of functions.

Return Values

Unless otherwise noted above,priocntl() returns0 on success. On failure,priocntl()returns-1 and setserrno to indicate the error.

Errors

Thepriocntl() function will fail if:

EAGAIN

An attempt to change the class of an LWP failed because of insufficient resources other than memory (for example, class-specific kernel data structures).

EFAULT

One of the arguments points to an illegal address.

EINVAL

The argumentcmd was invalid, an invalid or unconfigured class was specified, or one of the parameters specified was invalid.

ENOMEM

An attempt to change the class of an LWP failed because of insufficient memory.

EPERM

The {PRIV_PROC_PRIOCNTL} privilege is not asserted in the effective set of the calling LWP.

The calling LWP does not have sufficient privileges to affect the target LWP.

ERANGE

The requested time quantum is out of range.

ESRCH

None of the specified LWPs exist.

See Also

priocntl(1),dispadmin(1M),init(1M),exec(2),fork(2),nice(2),priocntlset(2),fx_dptbl(4),process(4),rt_dptbl(4),privileges(5)

Oracle Solaris Administration: Common Tasks

Programming Interfaces Guide

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices
PreviousNext

[8]ページ先頭

©2009-2025 Movatter.jp