1processor_bind(2)                System Calls                processor_bind(2)
2
3
4

NAME

6       processor_bind - bind LWPs to a processor
7

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

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 proces‐
21       sorid_t variable pointed to by obind to the previous binding of one  of
22       the specified LWPs, or to PBIND_NONE if the selected LWP was not bound.
23
24
25       If  idtype  is  P_PID, the binding affects all LWPs of the process with
26       process ID (PID) id.
27
28
29       If idtype is P_LWPID, the  binding  affects  the  LWP  of  the  current
30       process with LWP ID id.
31
32
33       If  idtype  is  P_TASKID, the binding affects all LWPs of all processes
34       with task ID id.
35
36
37       If idtype is P_PROJID, the binding affects all LWPs  of  all  processes
38       with project ID id.
39
40
41       If idtype is P_CTID, the binding affects all LWPs of all processes with
42       process contract ID id.
43
44
45       If idtype is P_ZONEID, the binding affects all LWPs  of  all  processes
46       with zone ID id.
47
48
49       If  id  is  P_MYID, the specified LWP, process, task, or project is the
50       current one.
51
52
53       If processorid is PBIND_NONE, the processor bindings of  the  specified
54       LWPs are cleared.
55
56
57       If  processorid is PBIND_QUERY, the processor bindings are not changed.
58
59
60       The  {PRIV_PROC_OWNER}  privilege must be asserted in the effective set
61       of the calling process or the real or effective user ID of the  calling
62       process  must  match  the  real  or effective user ID of the LWPs being
63       bound.  If the calling process does not have permission to  change  all
64       of  the specified LWPs, the bindings of the LWPs for which it does have
65       permission will be changed even though an error is returned.
66
67
68       Processor bindings are inherited across fork(2) and exec(2).
69

RETURN VALUES

71       Upon successful completion, 0 is returned.  Otherwise, −1  is  returned
72       and  errno is set to indicate the error.
73

ERRORS

75       The processor_bind() function will fail if:
76
77       EFAULT     The  location  pointed  to  by   obind  was not NULL and not
78                  writable by the user.
79
80
81       EINVAL     The specified processor is not on-line, or the idtype  argu‐
82                  ment  was not P_PID, P_LWPID, P_PROJID, P_TASKID, P_CTID, or
83                  P_ZONEID.
84
85                  The caller is in a non-global zone, the  pools  facility  is
86                  active,  and  the  processor  is  not a member of the zone's
87                  pool's processor set.
88
89
90       ENOTSUP    Binding a system process to a  processor  set  is  not  sup‐
91                  ported.
92
93
94       EPERM      The  {PRIV_PROC_OWNER}  privilege  is  not  asserted  in the
95                  effective set of the calling process and its real or  effec‐
96                  tive user ID does not match the real or effective user ID of
97                  one of the LWPs being bound.
98
99
100       ESRCH      No processes, LWPs, or tasks were found to match the  crite‐
101                  ria specified by idtype and  id.
102
103

ATTRIBUTES

105       See attributes(5) for descriptions of the following attributes:
106
107
108
109
110       ┌─────────────────────────────┬─────────────────────────────┐
111       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
112       ├─────────────────────────────┼─────────────────────────────┤
113       │Interface Stability          │Committed                    │
114       ├─────────────────────────────┼─────────────────────────────┤
115       │MT-Level                     │Async-Signal-Safe            │
116       └─────────────────────────────┴─────────────────────────────┘
117

SEE ALSO

119       pooladm(1M),  psradm(1M),  psrinfo(1M),  zoneadm(1M), exec(2), fork(2),
120       p_online(2),   pset_bind(2),   sysconf(3C),   process(4),   project(4),
121       attributes(5), privileges(5)
122
123
124
125SunOS 5.11                        13 Mar 2009                processor_bind(2)
Impressum