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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_CONTRACT_PROCESS_H
28 #define	_SYS_CONTRACT_PROCESS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/contract.h>
33 #include <sys/time.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 typedef struct ctmpl_process ctmpl_process_t;
40 typedef struct cont_process cont_process_t;
41 
42 /*
43  * ctr_params flags
44  */
45 #define	CT_PR_INHERIT	0x1	/* give contract to parent */
46 #define	CT_PR_NOORPHAN	0x2	/* kill when contract is abandoned */
47 #define	CT_PR_PGRPONLY	0x4	/* only kill process group on fatal errors */
48 #define	CT_PR_REGENT	0x8	/* automatically detach inherited contracts */
49 #define	CT_PR_ALLPARAM	0xf
50 
51 /*
52  * ctr_ev_* flags
53  */
54 #define	CT_PR_EV_EMPTY	0x1	/* contract is empty */
55 #define	CT_PR_EV_FORK	0x2	/* process was forked (and was added) */
56 #define	CT_PR_EV_EXIT	0x4	/* process exited (and left contract) */
57 #define	CT_PR_EV_CORE	0x8	/* process dumps core */
58 #define	CT_PR_EV_SIGNAL	0x10	/* process received fatal signal */
59 #define	CT_PR_EV_HWERR	0x20	/* process experienced uncorrectable error */
60 #define	CT_PR_ALLEVENT	0x3f
61 #define	CT_PR_ALLFATAL	(CT_PR_EV_CORE | CT_PR_EV_SIGNAL | CT_PR_EV_HWERR)
62 
63 /*
64  * ctp_id values
65  */
66 #define	CTPP_EV_FATAL		0
67 #define	CTPP_PARAMS		1
68 #define	CTPP_SUBSUME		2
69 
70 /*
71  * Status fields
72  */
73 #define	CTPS_PARAMS		"ctps_params"
74 #define	CTPS_EV_FATAL		"ctps_ev_fatal"
75 #define	CTPS_MEMBERS		"ctps_members"
76 #define	CTPS_CONTRACTS		"ctps_contracts"
77 
78 /*
79  * Event fields
80  */
81 #define	CTPE_PID	"ctpe_pid"
82 #define	CTPE_PPID	"ctpe_ppid"
83 #define	CTPE_ZCOREFILE	"ctpe_zcorefile"
84 #define	CTPE_GCOREFILE	"ctpe_gcorefile"
85 #define	CTPE_PCOREFILE	"ctpe_pcorefile"
86 #define	CTPE_SIGNAL	"ctpe_signal"
87 #define	CTPE_SENDER	"ctpe_sender"
88 #define	CTPE_SENDCT	"ctpe_sendct"
89 #define	CTPE_EXITSTATUS	"ctpe_exitstatus"
90 
91 #ifdef	__cplusplus
92 }
93 #endif
94 
95 #endif	/* _SYS_CONTRACT_PROCESS_H */
96