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

NAME

6       pset_bind - bind LWPs to a set of processors
7

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

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 pro‐
68       cessor 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

RETURN VALUES

76       Upon successful completion, 0 is returned. Otherwise,  −1  is  returned
77       and errno is set to indicate the error.
78

ERRORS

80       The pset_bind() function will fail if:
81
82       EBUSY      One  of  the LWPs is bound to a processor, and the specified
83                  processor set does not include that processor.
84
85
86       EFAULT     The location pointed to  by  opset  was  not  NULL  and  not
87                  writable by the user.
88
89
90       EINVAL     An  invalid  processor  set ID was specified;  or idtype was
91                  not P_PID, P_LWPID, P_PROJID, P_TASKID, P_ZONEID, or P_CTID.
92
93
94       ENOTSUP    The  pools  facility  is  active.    See   pooladm(1M)   and
95                  pool_set_status(3POOL)  for  information  about enabling and
96                  disabling the pools facility.  Processes  can  be  bound  to
97                  pools  using  the poolbind(1M) utility or the pool_set_bind‐
98                  ing(3POOL) function.
99
100                  Binding a system process to a  processor  set  is  not  sup‐
101                  ported.
102
103
104       EPERM      The {PRIV_PROC_OWNER} is not asserted in the effecive set of
105                  the calling process and either the real or effective user ID
106                  of  the calling process does not match the real or effective
107                  user ID of one of the LWPs being bound, or the processor set
108                  from which one or more of the LWPs are being unbound has the
109                  PSET_NOESCAPE attribute set and {PRIV_SYS_RES_CONFIG) is not
110                  asserted  in  the  effective set of the calling process. See
111                  pset_setattr(2) for more  information  about  processor  set
112                  attributes.
113
114
115       ESRCH      No  processes, LWPs, or tasks were found to match the crite‐
116                  ria specified by idtype and id.
117
118

ATTRIBUTES

120       See attributes(5) for descriptions of the following attributes:
121
122
123
124
125       ┌─────────────────────────────┬─────────────────────────────┐
126       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
127       ├─────────────────────────────┼─────────────────────────────┤
128       │Interface Stability          │Committed                    │
129       ├─────────────────────────────┼─────────────────────────────┤
130       │MT-Level                     │Async-Signal-Safe            │
131       └─────────────────────────────┴─────────────────────────────┘
132

SEE ALSO

134       pbind(1M), pooladm(1M),  poolbind(1M),  psrset(1M),  exec(2),  fork(2),
135       processor_bind(2),   pset_create(2),   pset_info(2),   pset_setattr(2),
136       pool_set_binding(3POOL),  pool_set_status(3POOL),  pset_getloadavg(3C),
137       process(4), project(4), attributes(5), privileges(5)
138
139
140
141SunOS 5.11                        13 Mar 2009                     pset_bind(2)
Impressum