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.
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
42 #define PSEXP_PSARGS 0x1 /* Match against psargs rather than fname */
43 #define PSEXP_EXACT 0x2 /* Match must be exact (entire string) */
45 typedef struct psexp
{
46 idtab_t ps_euids
; /* Table of effective uids to match */
47 idtab_t ps_ruids
; /* Table of real uids to match */
48 idtab_t ps_rgids
; /* Table of real gids to match */
49 idtab_t ps_ppids
; /* Table of parent process-ids to match */
50 idtab_t ps_pgids
; /* Table of process group-ids to match */
51 idtab_t ps_sids
; /* Table of process session-ids to match */
52 idtab_t ps_ttys
; /* Table of tty dev_t values to match */
53 idtab_t ps_projids
; /* Table of project ids to match */
54 idtab_t ps_taskids
; /* Table of task ids to match */
55 idtab_t ps_zoneids
; /* Table of zone ids to match */
56 idtab_t ps_ctids
; /* Table of contract ids to match */
57 const char *ps_pat
; /* Uncompiled fname/psargs regexp pattern */
58 regex_t ps_reg
; /* Compiled fname/psargs regexp */
61 extern void psexp_create(psexp_t
*);
62 extern void psexp_destroy(psexp_t
*);
63 extern int psexp_compile(psexp_t
*);
64 extern int psexp_match(psexp_t
*, psinfo_t
*, int);