1 PROCESSOR_BIND(2)                System Calls                PROCESSOR_BIND(2)
   2 
   3 
   4 
   5 NAME
   6        processor_bind - bind LWPs to a processor
   7 
   8 SYNOPSIS
   9        #include <sys/types.h>
  10        #include <sys/processor.h>
  11        #include <sys/procset.h>
  12 
  13        int processor_bind(idtype_t idtype, id_t id, processorid_t processorid,
  14             processorid_t *obind);
  15 
  16 
  17 DESCRIPTION
  18        The processor_bind() function binds the LWP (lightweight process) or
  19        set of LWPs specified by idtype and id to the processor specified by
  20        processorid. If obind is not NULL, this function also sets the
  21        processorid_t variable pointed to by obind to the previous binding of
  22        one of the specified LWPs, or to PBIND_NONE if the selected LWP was not
  23        bound.
  24 
  25 
  26        If idtype is P_PID, the binding affects all LWPs of the process with
  27        process ID (PID) id.
  28 
  29 
  30        If idtype is P_LWPID, the binding affects the LWP of the current
  31        process with LWP ID id.
  32 
  33 
  34        If idtype is P_TASKID, the binding affects all LWPs of all processes
  35        with task ID id.
  36 
  37 
  38        If idtype is P_PROJID, the binding affects all LWPs of all processes
  39        with project 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 idtype is P_ZONEID, the binding affects all LWPs of all processes
  47        with zone ID id.
  48 
  49 
  50        If id is P_MYID, the specified LWP, process, task, or project is the
  51        current one.
  52 
  53 
  54        If processorid is PBIND_NONE, the processor bindings of the specified
  55        LWPs are cleared.
  56 
  57 
  58        If processorid is PBIND_QUERY, the processor bindings are not changed.
  59 
  60 
  61        The {PRIV_PROC_OWNER} privilege must be asserted in the effective set
  62        of the calling process or the real or effective user ID of the calling
  63        process must match the real or effective user ID of the LWPs being
  64        bound.  If the calling process does not have permission to change all
  65        of the specified LWPs, the bindings of the LWPs for which it does have
  66        permission will be changed even though an error is returned.
  67 
  68 
  69        Processor bindings are inherited across fork(2) and exec(2).
  70 
  71 RETURN VALUES
  72        Upon successful completion, 0 is returned.  Otherwise, -1 is returned
  73        and  errno is set to indicate the error.
  74 
  75 ERRORS
  76        The processor_bind() function will fail if:
  77 
  78        EFAULT
  79                   The location pointed to by obind was not NULL and not
  80                   writable by the user.
  81 
  82 
  83        EINVAL
  84                   The processor is not on-line.
  85 
  86                   The LWP is bound to a processor set or resource pool for
  87                   which the processor is not a member.
  88 
  89                   The idtype argument is not P_PID, P_LWPID, P_PROJID,
  90                   P_TASKID, P_CTID, or P_ZONEID.
  91 
  92 
  93        ENOTSUP
  94                   Binding a system process to a processor set is not
  95                   supported.
  96 
  97 
  98        EPERM
  99                   The {PRIV_PROC_OWNER} privilege is not asserted in the
 100                   effective set of the calling process and its real or
 101                   effective user ID does not match the real or effective user
 102                   ID of one of the LWPs being bound.
 103 
 104 
 105        ESRCH
 106                   No processes, LWPs, or tasks were found to match the
 107                   criteria specified by idtype and id.
 108 
 109 
 110 ATTRIBUTES
 111        See attributes(5) for descriptions of the following attributes:
 112 
 113 
 114 
 115 
 116        +--------------------+-------------------+
 117        |  ATTRIBUTE TYPE    |  ATTRIBUTE VALUE  |
 118        +--------------------+-------------------+
 119        |Interface Stability | Committed         |
 120        +--------------------+-------------------+
 121        |MT-Level            | Async-Signal-Safe |
 122        +--------------------+-------------------+
 123 
 124 SEE ALSO
 125        pooladm(1M), psradm(1M), psrinfo(1M), zoneadm(1M), exec(2), fork(2),
 126        p_online(2), pset_bind(2), sysconf(3C), process(4), project(4),
 127        attributes(5), privileges(5)
 128 
 129 
 130 
 131                                December 27, 2015             PROCESSOR_BIND(2)