4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 #ifndef _SYS_PROCSET_H
32 #define _SYS_PROCSET_H
34 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6 */
40 #include <sys/feature_tests.h>
41 #include <sys/types.h>
42 #include <sys/signal.h>
45 * This file defines the data needed to specify a set of
46 * processes. These types are used by the sigsend, sigsendset,
47 * priocntl, priocntlset, waitid, evexit, and evexitset system
56 * The following defines the values for an identifier type. It
57 * specifies the interpretation of an id value. An idtype and
58 * id together define a simple set of processes.
61 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
62 idtype
/* pollutes XPG4.2 namespace */
65 P_PID
, /* A process identifier. */
66 P_PPID
, /* A parent process identifier. */
67 P_PGID
, /* A process group (job control group) */
69 P_SID
, /* A session identifier. */
70 P_CID
, /* A scheduling class identifier. */
71 P_UID
, /* A user identifier. */
72 P_GID
, /* A group identifier. */
73 P_ALL
, /* All processes. */
74 P_LWPID
, /* An LWP identifier. */
75 P_TASKID
, /* A task identifier. */
76 P_PROJID
, /* A project identifier. */
77 P_POOLID
, /* A pool identifier. */
78 P_ZONEID
, /* A zone identifier. */
79 P_CTID
, /* A (process) contract identifier. */
80 P_CPUID
, /* CPU identifier. */
81 P_PSETID
/* Processor set identifier */
86 * The following defines the operations which can be performed to
87 * combine two simple sets of processes to form another set of
90 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
92 POP_DIFF
, /* Set difference. The processes which */
93 /* are in the left operand set and not */
94 /* in the right operand set. */
95 POP_AND
, /* Set disjunction. The processes */
96 /* which are in both the left and right */
98 POP_OR
, /* Set conjunction. The processes */
99 /* which are in either the left or the */
100 /* right operand sets (or both). */
101 POP_XOR
/* Set exclusive or. The processes */
102 /* which are in either the left or */
103 /* right operand sets but not in both. */
108 * The following structure is used to define a set of processes.
109 * The set is defined in terms of two simple sets of processes
110 * and an operator which operates on these two operand sets.
112 typedef struct procset
{
113 idop_t p_op
; /* The operator connection the */
114 /* following two operands each */
115 /* of which is a simple set of */
119 /* The type of the left operand */
121 id_t p_lid
; /* The id of the left operand. */
124 /* The type of the right */
125 /* operand simple set. */
126 id_t p_rid
; /* The id of the right operand. */
130 * The following macro can be used to initialize a procset_t
133 #define setprocset(psp, op, ltype, lid, rtype, rid) \
134 (psp)->p_op = (op); \
135 (psp)->p_lidtype = (ltype); \
136 (psp)->p_lid = (lid); \
137 (psp)->p_ridtype = (rtype); \
138 (psp)->p_rid = (rid);
140 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
146 extern int dotoprocs(procset_t
*, int (*)(), char *);
147 extern int dotolwp(procset_t
*, int (*)(), char *);
148 extern int procinset(struct proc
*, procset_t
*);
149 extern int sigsendproc(struct proc
*, sigsend_t
*);
150 extern int sigsendset(procset_t
*, sigsend_t
*);
151 extern boolean_t
cur_inset_only(procset_t
*);
152 extern id_t
getmyid(idtype_t
);
160 #endif /* _SYS_PROCSET_H */