priocntlset - generalized process scheduler control
#include <sys/types.h> #include <sys/procset.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> long priocntlset(procset_t *psp, int cmd, /* arg */ ...);
The priocntlset() function changes the scheduling properties of running processes. priocntlset() has the same functions as the priocntl() function, but a more general way of specifying the set of processes whose scheduling properties are to be changed.
cmd specifies the function to be performed. arg is a pointer to a structure whose type depends on cmd. See priocntl(2) for the valid values of cmd and the corresponding arg structures.
psp is a pointer to a procset structure, which priocntlset() uses to specify the set of processes whose scheduling properties are to be changed. The procset structure contains the following members:
idop_t p_op; /* operator connecting left/right sets */ idtype_t p_lidtype; /* left set ID type */ id_t p_lid; /* left set ID */ idtype_t p_ridtype; /* right set ID type */ id_t p_rid; /* right set ID */
The p_lidtype and p_lid members specify the ID type and ID of one ("left") set of processes; the p_ridtype and p_rid members specify the ID type and ID of a second ("right") set of processes. ID types and IDs are specified just as for the priocntl() function. The p_op member specifies the operation to be performed on the two sets of processes to get the set of processes the function is to apply to. The valid values for p_op and the processes they specify are:
POP_DIFF
POP_AND
POP_OR
POP_XOR
The following macro, which is defined in <procset.h>, offers a convenient way to initialize a procset structure:
#define setprocset(psp, op, ltype, lid, rtype, rid) \ (psp)->p_op = (op), \ (psp)->p_lidtype = (ltype), \ (psp)->p_lid = (lid), \ (psp)->p_ridtype = (rtype), \ (psp)->p_rid = (rid),
Unless otherwise noted above, priocntlset() returns 0 on success. Otherwise, it returns -1 and sets errno to indicate the error.
The priocntlset() function will fail if:
EAGAIN
EFAULT
EINVAL
ENOMEM
EPERM
The calling LWP does not have sufficient privileges to affect the target LWP.
ERANGE
ESRCH
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |