4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _SYS_CONTRACT_PROCESS_H
27 #define _SYS_CONTRACT_PROCESS_H
28
29 #pragma ident "%Z%%M% %I% %E% SMI"
30
31 #include <sys/contract.h>
32 #include <sys/time.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 typedef struct ctmpl_process ctmpl_process_t;
39 typedef struct cont_process cont_process_t;
40
41 /*
42 * Default value for FMRI terms
43 */
44 #define CT_PR_SVC_DEFAULT "inherit:"
45
46 /*
47 * zone_enter() pseudo-FMRI
48 */
49 #define CT_PR_SVC_FMRI_ZONE_ENTER "svc:/system/zone_enter:default"
50
51 /*
52 * ctr_params flags
53 */
54 #define CT_PR_INHERIT 0x1 /* give contract to parent */
55 #define CT_PR_NOORPHAN 0x2 /* kill when contract is abandoned */
56 #define CT_PR_PGRPONLY 0x4 /* only kill process group on fatal errors */
57 #define CT_PR_REGENT 0x8 /* automatically detach inherited contracts */
58 #define CT_PR_ALLPARAM 0xf
59
60 /*
61 * ctr_ev_* flags
62 */
63 #define CT_PR_EV_EMPTY 0x1 /* contract is empty */
64 #define CT_PR_EV_FORK 0x2 /* process was forked (and was added) */
65 #define CT_PR_EV_EXIT 0x4 /* process exited (and left contract) */
66 #define CT_PR_EV_CORE 0x8 /* process dumps core */
67 #define CT_PR_EV_SIGNAL 0x10 /* process received fatal signal */
68 #define CT_PR_EV_HWERR 0x20 /* process experienced uncorrectable error */
69 #define CT_PR_ALLEVENT 0x3f
70 #define CT_PR_ALLFATAL (CT_PR_EV_CORE | CT_PR_EV_SIGNAL | CT_PR_EV_HWERR)
71
72 /*
73 * ctp_id values
74 */
75 #define CTPP_EV_FATAL 0
76 #define CTPP_PARAMS 1
77 #define CTPP_SUBSUME 2
78 #define CTPP_SVC_FMRI 3
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 * Copyright 2015 Joyent, Inc.
25 */
26
27 #ifndef _SYS_CONTRACT_PROCESS_H
28 #define _SYS_CONTRACT_PROCESS_H
29
30 #include <sys/contract.h>
31 #include <sys/time.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 typedef struct ctmpl_process ctmpl_process_t;
38 typedef struct cont_process cont_process_t;
39
40 /*
41 * Default value for FMRI terms
42 */
43 #define CT_PR_SVC_DEFAULT "inherit:"
44
45 /*
46 * zone_enter() pseudo-FMRI
47 */
48 #define CT_PR_SVC_FMRI_ZONE_ENTER "svc:/system/zone_enter:default"
49
50 /*
51 * ctr_params flags
52 */
53 #define CT_PR_INHERIT 0x1 /* give contract to parent */
54 #define CT_PR_NOORPHAN 0x2 /* kill when contract is abandoned */
55 #define CT_PR_PGRPONLY 0x4 /* only kill process group on fatal errors */
56 #define CT_PR_REGENT 0x8 /* automatically detach inherited contracts */
57 #define CT_PR_KEEP_EXEC 0x10 /* preserve template accross exec */
58 #define CT_PR_ALLPARAM 0x1f
59
60 /*
61 * ctr_ev_* flags
62 */
63 #define CT_PR_EV_EMPTY 0x1 /* contract is empty */
64 #define CT_PR_EV_FORK 0x2 /* process was forked (and was added) */
65 #define CT_PR_EV_EXIT 0x4 /* process exited (and left contract) */
66 #define CT_PR_EV_CORE 0x8 /* process dumps core */
67 #define CT_PR_EV_SIGNAL 0x10 /* process received fatal signal */
68 #define CT_PR_EV_HWERR 0x20 /* process experienced uncorrectable error */
69 #define CT_PR_ALLEVENT 0x3f
70 #define CT_PR_ALLFATAL (CT_PR_EV_CORE | CT_PR_EV_SIGNAL | CT_PR_EV_HWERR)
71
72 /*
73 * ctp_id values
74 */
75 #define CTPP_EV_FATAL 0
76 #define CTPP_PARAMS 1
77 #define CTPP_SUBSUME 2
78 #define CTPP_SVC_FMRI 3
|