#ifndef MPLIB1_BPO_PROC_INTERNAL #define MPLIB1_BPO_PROC_INTERNAL /* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * $Source$ * $Author$ * $Date$ * $Revision$ * ******************************************************************************* * * Change History * * $Log$ * ******************************************************************************* */ #ident "$Header$" #ifdef CXREF #include #include #endif #ifndef MPLIB1_CONFIG #include #endif #ifndef MPLIB1_BPO_LOCK #include #endif #ifndef MPLIB1_BPO_LIST #include #endif #ifndef MPLIB1_BPO_INIT #include #endif #ifndef MPLIB1_BPO_ALLOC #include #endif /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ #ifndef BIT #define BIT(n) (1<<(n)) #endif #define SHM_INHERIT_GROUP BIT(0) #define SHM_INHERIT_PROGRAM BIT(1) #define SHM_AUTOMAGIC_PIPE BIT(2) #define SHM_CHECK_ALL_PROCESSES 1 #define SHM_CHECK_THIS_PROCESS 2 #define SHM_CHECK_DEAD_PROCESSES 3 /* Return values to the validate processes inform call */ #define SHM_LEAVE_PROC 0 #define SHM_DELETE_PROC 1 #ifndef PID_STR_LEN #define PID_STR_LEN 12 #endif /* ------------------------------------------------------------------ structures ------------------------------------------------------------------ */ struct shm_proc_list { off_t lno_me; int serial_nbr; time_t update_tm; bpo_List_t proc_List; }; struct shm_process { off_t lno_me; bpo_Node_t proc_Node; pid_t pid; time_t pid_start_tm; bpo_List_t pid_resources; char pid_str[PID_STR_LEN]; off_t pid_grp_o; off_t pid_nm_o; off_t pid_fifo_o; }; struct shm_process_private { dl_Node_t spp_Node; pid_t pid; char pid_str[PID_STR_LEN]; char *pid_grp; char *pid_nm; char *pid_fifo; int fifo_fd; int fifo_created; mode_t fifo_mode; time_t pid_start_tm; struct shm_process *spp; }; struct cache_proc_list { dl_Node_t lnk_node; char ptr_str[40]; unsigned long serial_nbr; time_t update_tm; struct shm_proc_list *splp; dl_List_t proc_list; dl_List_t old_proc_list; }; typedef int (* Validate_Processes_t)( struct shm_process_private *shmpp, void *param1 ); /* ------------------------------------------------------------------ function definitions ------------------------------------------------------------------ */ /* Allocate functions */ extern struct shm_process_private * alloc_private_process( pid_t the_pid, const char *pid_grp, const char *pid_nm, const char *pid_fifo ); extern void free_private_process( struct shm_process_private *sppp ); #ifndef MPLIB1_BPO_PROC extern struct shm_process_private * Get_My_Proc_Details( mode_t privs ); extern struct shm_process_private * Check_My_Proc_Details( void ); #endif extern int Validate_Processes( const void * hint, int which_procs, Validate_Processes_t disp, void *param1 ); extern struct shm_proc_list *Find_Proc_List( const void *hint ); extern struct cache_proc_list *Get_Cache_Procs( const void *hint ); #endif /* -- End of File -- */