#pragma module ADC_CTXMGR "ADC_CTXMGR-1-X" /* **++ ** FACILITY: ** ** MODULE DESCRIPTION: ** This module contains routines to maintain ADC's user/session context ** in the OpenVMS Global section shared accros cluster. ** ** ** AUTHORS: ** ** Ruslan R. Laishev ** ** CREATION DATE: 11-SEP-2009 ** ** DESIGN ISSUES: ** ** ** MODIFICATION HISTORY: ** ** {@tbs@}... **-- */ /* ** ** INCLUDE FILES ** */ #include #include #include #include #include #include #include #include #include #define __NEW_STARLET 1 #include #include #include #include /* ** ** ADC DEFINITONS ** */ #include "adcdef.h" #include "macros.h" $DESCRIPTOR (sec_dsc, "ADC_CTXSEC"); static VA_RANGE in_addr; static VA_RANGE out_addr; static VA_RANGE del_addr; const int prot = 0x00FF; extern ADC_CXT *ctx_tbl extern int ctx_tblsz,csid; struct FAB fab; int _adc_ctx_init (void) { int status, sectsz = ctx_tblsz*(ADC_CTX)/512; /* ** Create or open section file */ fab = cc$rms_fab; fab.fab$b_fns = sec_dsc.dsc$w_length; fab.fab$l_fna = sec_dsc.dsc$a_pointer; fab.fab$l_alq = sectsz; fab.fab$l_fop = FAB$M_CIF|FAB$M_UFO|FAB$M_CBT; fab.fab$b_fac = FAB$M_PUT; fab.fab$b_rtv = -1; if ( (1 & (status = sys$create(&fab))) ) lib$signal(status,fab.fab$l_stv); if ( fab.fab$l_alq != maxcontexts * sizeof(ADC_CTX) ) _adc_log(ADC_SZNOTMATCH,fab.fab$l_alq,sectsz,maxcontexts); /* ** Map the file to the P0 region */ if ( (1 & (status = sys$crmpsc(&in_addr,&out_addr,0, SEC$M_EXPREG|SEC$M_WRT,&sec_dsc,0,0,fab.fab$l_stv,sectsz,0,prot,0))) ) lib%signal(status); }