p If .Fa psid is set to .Dv PS_QUERY , then the current processor set ID will be returned into .Fa psid , and no assignment will be performed.
p If .Fa psid is set to .Dv PS_MYID , then the processor set ID of the calling process will be used, and .Fa psid will be ignored.
p If .Fa psid is set to .Dv PS_NONE , any assignment to the processor will be cleared. t Fn pset_bind psid type id opsid Binds the target specified by .Fa id to the processor set specified by .Fa psid . The current processor set ID to which the target is bound or .Dv PS_NONE will be returned in .Fa opsid , if the pointer is not .Dv NULL . .Nx supports the following types of targets specified by .Fa type : l -tag -width P_PID t Dv P_PID Process identified by the PID. t Dv P_LWPID Thread of the calling process indentified by the LID. .El
p If .Fa psid is set to .Dv PS_QUERY , then the current processor set ID to which the target is bound or .Dv PS_NONE will be returned in .Fa opsid , and no binding will be performed. If .Fa psid is set to .Dv PS_MYID , then the processor set ID of the calling process will be used.
p If .Fa psid is set to .Dv PS_NONE , the specified target will be unbound from the processor set. t Fn pset_destroy psid Destroys the processor set specified by .Fa psid . Before destroying the processor set, all related assignments of the processors will be cleared, and all bound threads will be unbound.
p If .Fa psid is .Dv PS_MYID , the processor set ID of the caller thread will be used. .El .Ss NOTES The .Fa pset_bind function can return the current processor set ID to which the target is bound, or .Dv PS_NONE . However, for example, the process may have many threads, which could be bound to different processor sets. In such a case it is unspecified which thread will be used to return the information. .Sh RETURN VALUES Upon successful completion these functions return 0. Otherwise, -1 is returned and .Va errno is set to indicate the error. .Sh ERRORS The .Fn pset_create function fails if: l -tag -width Er t Bq Er ENOMEM No memory is available for creation of the processor set, or limit of the allowed count of the processor sets was reached. t Bq Er EPERM The calling process is not the super-user. .El
p The .Fn pset_assign function fails if: l -tag -width Er t Bq Er EBUSY Another operation is performing on the processor set. t Bq Er EINVAL .Fa psid or .Fa cpuid are invalid. t Bq Er EPERM The calling process is not the super-user, and .Fa psid is not .Dv PS_QUERY . .El
p The .Fn pset_bind function fails if: l -tag -width Er t Bq Er EBUSY Another operation is performing on the processor set. t Bq Er EINVAL .Fa psid or .Fa type are invalid. t Bq Er EPERM The calling process is not the super-user, and .Fa psid is not .Dv PS_QUERY . t Bq Er ESRCH The specified target was not found. .El
p The .Fn pset_destroy function fails if: l -tag -width Er t Bq Er EBUSY Another operation is performing on the processor set. t Bq Er EPERM The calling process is not the super-user. .El .Sh SEE ALSO .Xr sched 3 , .Xr schedctl 8 .Sh STANDARDS This API is expected to be compatible with the APIs found in Solaris and HP-UX operating systems. .Sh HISTORY The processor sets appeared in .Nx 5.0 . .Sh BUGS Currently, these functions are valid and work correctly only with the SCHED_M2 thread scheduler implementation.