10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*6073Sacruz * Common Development and Distribution License (the "License"). 6*6073Sacruz * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*6073Sacruz * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_CONTRACT_PROCESS_H 270Sstevel@tonic-gate #define _SYS_CONTRACT_PROCESS_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #include <sys/contract.h> 320Sstevel@tonic-gate #include <sys/time.h> 330Sstevel@tonic-gate 340Sstevel@tonic-gate #ifdef __cplusplus 350Sstevel@tonic-gate extern "C" { 360Sstevel@tonic-gate #endif 370Sstevel@tonic-gate 380Sstevel@tonic-gate typedef struct ctmpl_process ctmpl_process_t; 390Sstevel@tonic-gate typedef struct cont_process cont_process_t; 400Sstevel@tonic-gate 410Sstevel@tonic-gate /* 42*6073Sacruz * Default value for FMRI terms 43*6073Sacruz */ 44*6073Sacruz #define CT_PR_SVC_DEFAULT "inherit:" 45*6073Sacruz 46*6073Sacruz /* 47*6073Sacruz * zone_enter() pseudo-FMRI 48*6073Sacruz */ 49*6073Sacruz #define CT_PR_SVC_FMRI_ZONE_ENTER "svc:/system/zone_enter:default" 50*6073Sacruz 51*6073Sacruz /* 520Sstevel@tonic-gate * ctr_params flags 530Sstevel@tonic-gate */ 540Sstevel@tonic-gate #define CT_PR_INHERIT 0x1 /* give contract to parent */ 550Sstevel@tonic-gate #define CT_PR_NOORPHAN 0x2 /* kill when contract is abandoned */ 560Sstevel@tonic-gate #define CT_PR_PGRPONLY 0x4 /* only kill process group on fatal errors */ 570Sstevel@tonic-gate #define CT_PR_REGENT 0x8 /* automatically detach inherited contracts */ 580Sstevel@tonic-gate #define CT_PR_ALLPARAM 0xf 590Sstevel@tonic-gate 600Sstevel@tonic-gate /* 610Sstevel@tonic-gate * ctr_ev_* flags 620Sstevel@tonic-gate */ 630Sstevel@tonic-gate #define CT_PR_EV_EMPTY 0x1 /* contract is empty */ 640Sstevel@tonic-gate #define CT_PR_EV_FORK 0x2 /* process was forked (and was added) */ 650Sstevel@tonic-gate #define CT_PR_EV_EXIT 0x4 /* process exited (and left contract) */ 660Sstevel@tonic-gate #define CT_PR_EV_CORE 0x8 /* process dumps core */ 670Sstevel@tonic-gate #define CT_PR_EV_SIGNAL 0x10 /* process received fatal signal */ 680Sstevel@tonic-gate #define CT_PR_EV_HWERR 0x20 /* process experienced uncorrectable error */ 690Sstevel@tonic-gate #define CT_PR_ALLEVENT 0x3f 700Sstevel@tonic-gate #define CT_PR_ALLFATAL (CT_PR_EV_CORE | CT_PR_EV_SIGNAL | CT_PR_EV_HWERR) 710Sstevel@tonic-gate 720Sstevel@tonic-gate /* 730Sstevel@tonic-gate * ctp_id values 740Sstevel@tonic-gate */ 750Sstevel@tonic-gate #define CTPP_EV_FATAL 0 760Sstevel@tonic-gate #define CTPP_PARAMS 1 770Sstevel@tonic-gate #define CTPP_SUBSUME 2 78*6073Sacruz #define CTPP_SVC_FMRI 3 79*6073Sacruz #define CTPP_SVC_CTID 4 80*6073Sacruz #define CTPP_SVC_CREATOR 5 81*6073Sacruz #define CTPP_CREATOR_AUX 6 820Sstevel@tonic-gate 830Sstevel@tonic-gate /* 840Sstevel@tonic-gate * Status fields 850Sstevel@tonic-gate */ 860Sstevel@tonic-gate #define CTPS_PARAMS "ctps_params" 870Sstevel@tonic-gate #define CTPS_EV_FATAL "ctps_ev_fatal" 880Sstevel@tonic-gate #define CTPS_MEMBERS "ctps_members" 890Sstevel@tonic-gate #define CTPS_CONTRACTS "ctps_contracts" 90*6073Sacruz #define CTPS_SVC_FMRI "ctps_svc_fmri" 91*6073Sacruz #define CTPS_SVC_CTID "ctps_svc_ctid" 92*6073Sacruz #define CTPS_SVC_CREATOR "ctps_svc_creator" 93*6073Sacruz #define CTPS_CREATOR_AUX "ctps_creator_aux" 940Sstevel@tonic-gate 950Sstevel@tonic-gate /* 960Sstevel@tonic-gate * Event fields 970Sstevel@tonic-gate */ 980Sstevel@tonic-gate #define CTPE_PID "ctpe_pid" 990Sstevel@tonic-gate #define CTPE_PPID "ctpe_ppid" 1000Sstevel@tonic-gate #define CTPE_ZCOREFILE "ctpe_zcorefile" 1010Sstevel@tonic-gate #define CTPE_GCOREFILE "ctpe_gcorefile" 1020Sstevel@tonic-gate #define CTPE_PCOREFILE "ctpe_pcorefile" 1030Sstevel@tonic-gate #define CTPE_SIGNAL "ctpe_signal" 1040Sstevel@tonic-gate #define CTPE_SENDER "ctpe_sender" 1050Sstevel@tonic-gate #define CTPE_SENDCT "ctpe_sendct" 1060Sstevel@tonic-gate #define CTPE_EXITSTATUS "ctpe_exitstatus" 1070Sstevel@tonic-gate 1080Sstevel@tonic-gate #ifdef __cplusplus 1090Sstevel@tonic-gate } 1100Sstevel@tonic-gate #endif 1110Sstevel@tonic-gate 1120Sstevel@tonic-gate #endif /* _SYS_CONTRACT_PROCESS_H */ 113