process.h revision 6073:47f6aa7a8077
1279377Simp/*
2279377Simp * CDDL HEADER START
3279377Simp *
4279377Simp * The contents of this file are subject to the terms of the
5279377Simp * Common Development and Distribution License (the "License").
6279377Simp * You may not use this file except in compliance with the License.
7279377Simp *
8279377Simp * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9279377Simp * or http://www.opensolaris.org/os/licensing.
10279377Simp * See the License for the specific language governing permissions
11279377Simp * and limitations under the License.
12279377Simp *
13279377Simp * When distributing Covered Code, include this CDDL HEADER in each
14279377Simp * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15279377Simp * If applicable, add the following below this CDDL HEADER, with the
16279377Simp * fields enclosed by brackets "[]" replaced with your own identifying
17279377Simp * information: Portions Copyright [yyyy] [name of copyright owner]
18279377Simp *
19279377Simp * CDDL HEADER END
20279377Simp */
21279377Simp/*
22279377Simp * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23279377Simp * Use is subject to license terms.
24279377Simp */
25279377Simp
26279377Simp#ifndef	_SYS_CONTRACT_PROCESS_H
27279377Simp#define	_SYS_CONTRACT_PROCESS_H
28279377Simp
29279377Simp#pragma ident	"%Z%%M%	%I%	%E% SMI"
30279377Simp
31279377Simp#include <sys/contract.h>
32279377Simp#include <sys/time.h>
33279377Simp
34279377Simp#ifdef	__cplusplus
35279377Simpextern "C" {
36279377Simp#endif
37279377Simp
38279377Simptypedef struct ctmpl_process ctmpl_process_t;
39279377Simptypedef struct cont_process cont_process_t;
40279377Simp
41279377Simp/*
42279377Simp * Default value for FMRI terms
43279377Simp */
44279377Simp#define	CT_PR_SVC_DEFAULT	"inherit:"
45279377Simp
46279377Simp/*
47279377Simp * zone_enter() pseudo-FMRI
48279377Simp */
49279377Simp#define	CT_PR_SVC_FMRI_ZONE_ENTER	"svc:/system/zone_enter:default"
50279377Simp
51279377Simp/*
52279377Simp * ctr_params flags
53279377Simp */
54279377Simp#define	CT_PR_INHERIT	0x1	/* give contract to parent */
55295436Sandrew#define	CT_PR_NOORPHAN	0x2	/* kill when contract is abandoned */
56295436Sandrew#define	CT_PR_PGRPONLY	0x4	/* only kill process group on fatal errors */
57295436Sandrew#define	CT_PR_REGENT	0x8	/* automatically detach inherited contracts */
58279377Simp#define	CT_PR_ALLPARAM	0xf
59295436Sandrew
60295436Sandrew/*
61295436Sandrew * ctr_ev_* flags
62279377Simp */
63295436Sandrew#define	CT_PR_EV_EMPTY	0x1	/* contract is empty */
64295436Sandrew#define	CT_PR_EV_FORK	0x2	/* process was forked (and was added) */
65295436Sandrew#define	CT_PR_EV_EXIT	0x4	/* process exited (and left contract) */
66295436Sandrew#define	CT_PR_EV_CORE	0x8	/* process dumps core */
67279377Simp#define	CT_PR_EV_SIGNAL	0x10	/* process received fatal signal */
68295436Sandrew#define	CT_PR_EV_HWERR	0x20	/* process experienced uncorrectable error */
69295436Sandrew#define	CT_PR_ALLEVENT	0x3f
70295436Sandrew#define	CT_PR_ALLFATAL	(CT_PR_EV_CORE | CT_PR_EV_SIGNAL | CT_PR_EV_HWERR)
71295436Sandrew
72279377Simp/*
73295436Sandrew * ctp_id values
74279377Simp */
75295436Sandrew#define	CTPP_EV_FATAL		0
76295436Sandrew#define	CTPP_PARAMS		1
77295436Sandrew#define	CTPP_SUBSUME		2
78295436Sandrew#define	CTPP_SVC_FMRI		3
79295436Sandrew#define	CTPP_SVC_CTID		4
80295436Sandrew#define	CTPP_SVC_CREATOR	5
81295436Sandrew#define	CTPP_CREATOR_AUX	6
82295436Sandrew
83279377Simp/*
84295436Sandrew * Status fields
85295436Sandrew */
86295436Sandrew#define	CTPS_PARAMS		"ctps_params"
87295436Sandrew#define	CTPS_EV_FATAL		"ctps_ev_fatal"
88279377Simp#define	CTPS_MEMBERS		"ctps_members"
89295436Sandrew#define	CTPS_CONTRACTS		"ctps_contracts"
90295436Sandrew#define	CTPS_SVC_FMRI		"ctps_svc_fmri"
91295436Sandrew#define	CTPS_SVC_CTID		"ctps_svc_ctid"
92279377Simp#define	CTPS_SVC_CREATOR	"ctps_svc_creator"
93295436Sandrew#define	CTPS_CREATOR_AUX	"ctps_creator_aux"
94295436Sandrew
95295436Sandrew/*
96279377Simp * Event fields
97295436Sandrew */
98295436Sandrew#define	CTPE_PID	"ctpe_pid"
99295436Sandrew#define	CTPE_PPID	"ctpe_ppid"
100295436Sandrew#define	CTPE_ZCOREFILE	"ctpe_zcorefile"
101295436Sandrew#define	CTPE_GCOREFILE	"ctpe_gcorefile"
102295436Sandrew#define	CTPE_PCOREFILE	"ctpe_pcorefile"
103279377Simp#define	CTPE_SIGNAL	"ctpe_signal"
104295436Sandrew#define	CTPE_SENDER	"ctpe_sender"
105295436Sandrew#define	CTPE_SENDCT	"ctpe_sendct"
106295436Sandrew#define	CTPE_EXITSTATUS	"ctpe_exitstatus"
107295436Sandrew
108279377Simp#ifdef	__cplusplus
109295436Sandrew}
110295436Sandrew#endif
111295436Sandrew
112295436Sandrew#endif	/* _SYS_CONTRACT_PROCESS_H */
113279377Simp