1 PSET_BIND(2) System Calls PSET_BIND(2) 2 3 4 5 NAME 6 pset_bind - bind LWPs to a set of processors 7 8 SYNOPSIS 9 #include <sys/pset.h> 10 11 int pset_bind(psetid_t pset, idtype_t idtype, id_t id, psetid_t *opset); 12 13 14 DESCRIPTION 15 The pset_bind() function binds the LWP or set of LWPs specified by 16 idtype and id to the processor set specified by pset. If opset is not 17 NULL, pset_bind() sets the psetid_t variable pointed to by opset to the 18 previous processor set binding of one of the specified LWP, or to 19 PS_NONE if the selected LWP was not bound. 20 21 22 If idtype is P_PID, the binding affects all LWPs of the process with 23 process ID (PID) id. 24 25 26 If idtype is P_LWPID, the binding affects the LWP of the current 27 process with LWP ID id. 28 29 30 If idtype is P_TASKID, the binding affects all LWPs of all processes 31 with task ID id. 32 33 34 If idtype is P_PROJID, the binding affects all LWPs of all processes 35 with project ID id. 36 37 38 If idtype is P_ZONEID, the binding affects all LWPs of all processes 39 with zone ID id. 40 41 42 If idtype is P_CTID, the binding affects all LWPs of all processes with 43 process contract ID id. 44 45 46 If id is P_MYID, the specified LWP, process, task, process, zone, or 47 process contract is the current one. 48 49 50 If pset is PS_NONE, the processor set bindings of the specified LWPs 51 are cleared. 52 53 54 If pset is PS_QUERY, the processor set bindings are not changed. 55 56 57 If pset is PS_MYID, the specified LWPs are bound to the same processor 58 set as the caller. If the caller is not bound to a processor set, the 59 processor set bindings are cleared. 60 61 62 The {PRIV_SYS_RES_CONFIG} privilege must be asserted in the effective 63 set of the calling process or pset must be PS_QUERY. 64 65 66 LWPs that have been bound to a processor with processor_bind(2) may 67 also be bound to a processor set if the processor is part of the 68 processor set. If this occurs, the binding to the processor remains in 69 effect. If the processor binding is later removed, the processor set 70 binding becomes effective. 71 72 73 Processor set bindings are inherited across fork(2) and exec(2). 74 75 RETURN VALUES 76 Upon successful completion, 0 is returned. Otherwise, -1 is returned 77 and errno is set to indicate the error. 78 79 ERRORS 80 The pset_bind() function will fail if: 81 82 EBUSY 83 One of the LWPs is bound to a processor, and the specified 84 processor set does not include that processor. 85 86 87 EFAULT 88 The location pointed to by opset was not NULL and not 89 writable by the user. 90 91 92 EINVAL 93 An invalid processor set ID was specified; or idtype was 94 not P_PID, P_LWPID, P_PROJID, P_TASKID, P_ZONEID, or P_CTID. 95 96 97 ENOTSUP 98 The pools facility is active. See pooladm(1M) and 99 pool_set_status(3POOL) for information about enabling and 100 disabling the pools facility. Processes can be bound to 101 pools using the poolbind(1M) utility or the 102 pool_set_binding(3POOL) function. 103 104 Binding a system process to a processor set is not 105 supported. 106 107 108 EPERM 109 The {PRIV_PROC_OWNER} is not asserted in the effective set 110 of the calling process and either the real or effective user 111 ID of the calling process does not match the real or 112 effective user ID of one of the LWPs being bound, or the 113 processor set from which one or more of the LWPs are being 114 unbound has the PSET_NOESCAPE attribute set and 115 {PRIV_SYS_RES_CONFIG) is not asserted in the effective set 116 of the calling process. See pset_setattr(2) for more 117 information about processor set attributes. 118 119 120 ESRCH 121 No processes, LWPs, or tasks were found to match the 122 criteria specified by idtype and id. 123 124 125 ATTRIBUTES 126 See attributes(5) for descriptions of the following attributes: 127 128 129 130 131 +--------------------+-------------------+ 132 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 133 +--------------------+-------------------+ 134 |Interface Stability | Committed | 135 +--------------------+-------------------+ 136 |MT-Level | Async-Signal-Safe | 137 +--------------------+-------------------+ 138 139 SEE ALSO 140 pbind(1M), pooladm(1M), poolbind(1M), psrset(1M), exec(2), fork(2), 141 processor_bind(2), pset_create(2), pset_info(2), pset_setattr(2), 142 pool_set_binding(3POOL), pool_set_status(3POOL), pset_getloadavg(3C), 143 process(4), project(4), attributes(5), privileges(5) 144 145 146 147 March 13, 2009 PSET_BIND(2)