xref: /titanic_50/usr/src/uts/common/sys/contract/process.h (revision 4445fffbbb1ea25fd0e9ea68b9380dd7a6709025)
1 /*
2  * CDDL HEADER START
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  */
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
79 #define	CTPP_SVC_CTID		4
80 #define	CTPP_SVC_CREATOR	5
81 #define	CTPP_CREATOR_AUX	6
82 
83 /*
84  * Status fields
85  */
86 #define	CTPS_PARAMS		"ctps_params"
87 #define	CTPS_EV_FATAL		"ctps_ev_fatal"
88 #define	CTPS_MEMBERS		"ctps_members"
89 #define	CTPS_CONTRACTS		"ctps_contracts"
90 #define	CTPS_SVC_FMRI		"ctps_svc_fmri"
91 #define	CTPS_SVC_CTID		"ctps_svc_ctid"
92 #define	CTPS_SVC_CREATOR	"ctps_svc_creator"
93 #define	CTPS_CREATOR_AUX	"ctps_creator_aux"
94 
95 /*
96  * Event fields
97  */
98 #define	CTPE_PID	"ctpe_pid"
99 #define	CTPE_PPID	"ctpe_ppid"
100 #define	CTPE_ZCOREFILE	"ctpe_zcorefile"
101 #define	CTPE_GCOREFILE	"ctpe_gcorefile"
102 #define	CTPE_PCOREFILE	"ctpe_pcorefile"
103 #define	CTPE_SIGNAL	"ctpe_signal"
104 #define	CTPE_SENDER	"ctpe_sender"
105 #define	CTPE_SENDCT	"ctpe_sendct"
106 #define	CTPE_EXITSTATUS	"ctpe_exitstatus"
107 
108 #ifdef	__cplusplus
109 }
110 #endif
111 
112 #endif	/* _SYS_CONTRACT_PROCESS_H */
113