1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _SYS_CONTRACT_PROCESS_H 28*0Sstevel@tonic-gate #define _SYS_CONTRACT_PROCESS_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #include <sys/contract.h> 33*0Sstevel@tonic-gate #include <sys/time.h> 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate #ifdef __cplusplus 36*0Sstevel@tonic-gate extern "C" { 37*0Sstevel@tonic-gate #endif 38*0Sstevel@tonic-gate 39*0Sstevel@tonic-gate typedef struct ctmpl_process ctmpl_process_t; 40*0Sstevel@tonic-gate typedef struct cont_process cont_process_t; 41*0Sstevel@tonic-gate 42*0Sstevel@tonic-gate /* 43*0Sstevel@tonic-gate * ctr_params flags 44*0Sstevel@tonic-gate */ 45*0Sstevel@tonic-gate #define CT_PR_INHERIT 0x1 /* give contract to parent */ 46*0Sstevel@tonic-gate #define CT_PR_NOORPHAN 0x2 /* kill when contract is abandoned */ 47*0Sstevel@tonic-gate #define CT_PR_PGRPONLY 0x4 /* only kill process group on fatal errors */ 48*0Sstevel@tonic-gate #define CT_PR_REGENT 0x8 /* automatically detach inherited contracts */ 49*0Sstevel@tonic-gate #define CT_PR_ALLPARAM 0xf 50*0Sstevel@tonic-gate 51*0Sstevel@tonic-gate /* 52*0Sstevel@tonic-gate * ctr_ev_* flags 53*0Sstevel@tonic-gate */ 54*0Sstevel@tonic-gate #define CT_PR_EV_EMPTY 0x1 /* contract is empty */ 55*0Sstevel@tonic-gate #define CT_PR_EV_FORK 0x2 /* process was forked (and was added) */ 56*0Sstevel@tonic-gate #define CT_PR_EV_EXIT 0x4 /* process exited (and left contract) */ 57*0Sstevel@tonic-gate #define CT_PR_EV_CORE 0x8 /* process dumps core */ 58*0Sstevel@tonic-gate #define CT_PR_EV_SIGNAL 0x10 /* process received fatal signal */ 59*0Sstevel@tonic-gate #define CT_PR_EV_HWERR 0x20 /* process experienced uncorrectable error */ 60*0Sstevel@tonic-gate #define CT_PR_ALLEVENT 0x3f 61*0Sstevel@tonic-gate #define CT_PR_ALLFATAL (CT_PR_EV_CORE | CT_PR_EV_SIGNAL | CT_PR_EV_HWERR) 62*0Sstevel@tonic-gate 63*0Sstevel@tonic-gate /* 64*0Sstevel@tonic-gate * ctp_id values 65*0Sstevel@tonic-gate */ 66*0Sstevel@tonic-gate #define CTPP_EV_FATAL 0 67*0Sstevel@tonic-gate #define CTPP_PARAMS 1 68*0Sstevel@tonic-gate #define CTPP_SUBSUME 2 69*0Sstevel@tonic-gate 70*0Sstevel@tonic-gate /* 71*0Sstevel@tonic-gate * Status fields 72*0Sstevel@tonic-gate */ 73*0Sstevel@tonic-gate #define CTPS_PARAMS "ctps_params" 74*0Sstevel@tonic-gate #define CTPS_EV_FATAL "ctps_ev_fatal" 75*0Sstevel@tonic-gate #define CTPS_MEMBERS "ctps_members" 76*0Sstevel@tonic-gate #define CTPS_CONTRACTS "ctps_contracts" 77*0Sstevel@tonic-gate 78*0Sstevel@tonic-gate /* 79*0Sstevel@tonic-gate * Event fields 80*0Sstevel@tonic-gate */ 81*0Sstevel@tonic-gate #define CTPE_PID "ctpe_pid" 82*0Sstevel@tonic-gate #define CTPE_PPID "ctpe_ppid" 83*0Sstevel@tonic-gate #define CTPE_ZCOREFILE "ctpe_zcorefile" 84*0Sstevel@tonic-gate #define CTPE_GCOREFILE "ctpe_gcorefile" 85*0Sstevel@tonic-gate #define CTPE_PCOREFILE "ctpe_pcorefile" 86*0Sstevel@tonic-gate #define CTPE_SIGNAL "ctpe_signal" 87*0Sstevel@tonic-gate #define CTPE_SENDER "ctpe_sender" 88*0Sstevel@tonic-gate #define CTPE_SENDCT "ctpe_sendct" 89*0Sstevel@tonic-gate #define CTPE_EXITSTATUS "ctpe_exitstatus" 90*0Sstevel@tonic-gate 91*0Sstevel@tonic-gate #ifdef __cplusplus 92*0Sstevel@tonic-gate } 93*0Sstevel@tonic-gate #endif 94*0Sstevel@tonic-gate 95*0Sstevel@tonic-gate #endif /* _SYS_CONTRACT_PROCESS_H */ 96