xref: /titanic_44/usr/src/uts/common/sys/contract/process.h (revision 7b209c2cc5ea45251aba06dcc6181d3f23da807a)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7b209c2cSacruz  * Common Development and Distribution License (the "License").
6*7b209c2cSacruz  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*7b209c2cSacruz  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_CONTRACT_PROCESS_H
277c478bd9Sstevel@tonic-gate #define	_SYS_CONTRACT_PROCESS_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/contract.h>
327c478bd9Sstevel@tonic-gate #include <sys/time.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
357c478bd9Sstevel@tonic-gate extern "C" {
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate typedef struct ctmpl_process ctmpl_process_t;
397c478bd9Sstevel@tonic-gate typedef struct cont_process cont_process_t;
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /*
42*7b209c2cSacruz  * Default value for FMRI terms
43*7b209c2cSacruz  */
44*7b209c2cSacruz #define	CT_PR_SVC_DEFAULT	"inherit:"
45*7b209c2cSacruz 
46*7b209c2cSacruz /*
47*7b209c2cSacruz  * zone_enter() pseudo-FMRI
48*7b209c2cSacruz  */
49*7b209c2cSacruz #define	CT_PR_SVC_FMRI_ZONE_ENTER	"svc:/system/zone_enter:default"
50*7b209c2cSacruz 
51*7b209c2cSacruz /*
527c478bd9Sstevel@tonic-gate  * ctr_params flags
537c478bd9Sstevel@tonic-gate  */
547c478bd9Sstevel@tonic-gate #define	CT_PR_INHERIT	0x1	/* give contract to parent */
557c478bd9Sstevel@tonic-gate #define	CT_PR_NOORPHAN	0x2	/* kill when contract is abandoned */
567c478bd9Sstevel@tonic-gate #define	CT_PR_PGRPONLY	0x4	/* only kill process group on fatal errors */
577c478bd9Sstevel@tonic-gate #define	CT_PR_REGENT	0x8	/* automatically detach inherited contracts */
587c478bd9Sstevel@tonic-gate #define	CT_PR_ALLPARAM	0xf
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate /*
617c478bd9Sstevel@tonic-gate  * ctr_ev_* flags
627c478bd9Sstevel@tonic-gate  */
637c478bd9Sstevel@tonic-gate #define	CT_PR_EV_EMPTY	0x1	/* contract is empty */
647c478bd9Sstevel@tonic-gate #define	CT_PR_EV_FORK	0x2	/* process was forked (and was added) */
657c478bd9Sstevel@tonic-gate #define	CT_PR_EV_EXIT	0x4	/* process exited (and left contract) */
667c478bd9Sstevel@tonic-gate #define	CT_PR_EV_CORE	0x8	/* process dumps core */
677c478bd9Sstevel@tonic-gate #define	CT_PR_EV_SIGNAL	0x10	/* process received fatal signal */
687c478bd9Sstevel@tonic-gate #define	CT_PR_EV_HWERR	0x20	/* process experienced uncorrectable error */
697c478bd9Sstevel@tonic-gate #define	CT_PR_ALLEVENT	0x3f
707c478bd9Sstevel@tonic-gate #define	CT_PR_ALLFATAL	(CT_PR_EV_CORE | CT_PR_EV_SIGNAL | CT_PR_EV_HWERR)
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /*
737c478bd9Sstevel@tonic-gate  * ctp_id values
747c478bd9Sstevel@tonic-gate  */
757c478bd9Sstevel@tonic-gate #define	CTPP_EV_FATAL		0
767c478bd9Sstevel@tonic-gate #define	CTPP_PARAMS		1
777c478bd9Sstevel@tonic-gate #define	CTPP_SUBSUME		2
78*7b209c2cSacruz #define	CTPP_SVC_FMRI		3
79*7b209c2cSacruz #define	CTPP_SVC_CTID		4
80*7b209c2cSacruz #define	CTPP_SVC_CREATOR	5
81*7b209c2cSacruz #define	CTPP_CREATOR_AUX	6
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate /*
847c478bd9Sstevel@tonic-gate  * Status fields
857c478bd9Sstevel@tonic-gate  */
867c478bd9Sstevel@tonic-gate #define	CTPS_PARAMS		"ctps_params"
877c478bd9Sstevel@tonic-gate #define	CTPS_EV_FATAL		"ctps_ev_fatal"
887c478bd9Sstevel@tonic-gate #define	CTPS_MEMBERS		"ctps_members"
897c478bd9Sstevel@tonic-gate #define	CTPS_CONTRACTS		"ctps_contracts"
90*7b209c2cSacruz #define	CTPS_SVC_FMRI		"ctps_svc_fmri"
91*7b209c2cSacruz #define	CTPS_SVC_CTID		"ctps_svc_ctid"
92*7b209c2cSacruz #define	CTPS_SVC_CREATOR	"ctps_svc_creator"
93*7b209c2cSacruz #define	CTPS_CREATOR_AUX	"ctps_creator_aux"
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate /*
967c478bd9Sstevel@tonic-gate  * Event fields
977c478bd9Sstevel@tonic-gate  */
987c478bd9Sstevel@tonic-gate #define	CTPE_PID	"ctpe_pid"
997c478bd9Sstevel@tonic-gate #define	CTPE_PPID	"ctpe_ppid"
1007c478bd9Sstevel@tonic-gate #define	CTPE_ZCOREFILE	"ctpe_zcorefile"
1017c478bd9Sstevel@tonic-gate #define	CTPE_GCOREFILE	"ctpe_gcorefile"
1027c478bd9Sstevel@tonic-gate #define	CTPE_PCOREFILE	"ctpe_pcorefile"
1037c478bd9Sstevel@tonic-gate #define	CTPE_SIGNAL	"ctpe_signal"
1047c478bd9Sstevel@tonic-gate #define	CTPE_SENDER	"ctpe_sender"
1057c478bd9Sstevel@tonic-gate #define	CTPE_SENDCT	"ctpe_sendct"
1067c478bd9Sstevel@tonic-gate #define	CTPE_EXITSTATUS	"ctpe_exitstatus"
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1097c478bd9Sstevel@tonic-gate }
1107c478bd9Sstevel@tonic-gate #endif
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate #endif	/* _SYS_CONTRACT_PROCESS_H */
113