#include #include #include #include "pcbdef.h" #include #include #include #include #include PCB pcb; int *pcbvec; int maxpix; int epid; #define INIT_SDESC(dsc, len, ptr) {(dsc).dsc$b_dtype = DSC$K_DTYPE_T;\ (dsc).dsc$b_class = DSC$K_CLASS_S; (dsc).dsc$w_length = (len);\ (dsc).dsc$a_pointer = (ptr);} int getpcb (void) { int status = SS$_NORMAL,ind = 0; int *ptr; PCB *pcbptr; char buf [ 32 ]; $DESCRIPTOR(fao,"!UL -> !XL!/"); struct dsc$descriptor_s buf_dsc; #pragma nostandard globalref SCH$GL_PCBVEC; globalref SCH$GL_MAXPIX; #pragma standard pcbvec = ptr = (int *)SCH$GL_PCBVEC; maxpix = SCH$GL_MAXPIX; for ( ind = 0;ind < maxpix;ind++,ptr++) { pcbptr = ((PCB *) *ptr); if ( pcbptr->pcb$l_epid == epid ) { memcpy(&pcb,pcbptr,sizeof(PCB)); return SS$_NORMAL; } } return SS$_ABORT; } int main (int argc, char ** argv[]) { int status,ind; sscanf(argv[1],"%x",&epid); printf("EPID = %08.8x\n",epid); if ( !(1 & (status = sys$cmkrnl(getpcb,0))) ) return status; printf("SCH$GL_PCBVEC = %08.8x,SCH$GL_MAXPIX = %08.8u\n",pcbvec,maxpix); printf("status = %08.8x, status2 = %08.8x",pcb.pcb$l_sts,pcb.pcb$l_sts2); }