static void ualarm_AST(Alarm *a) { int iss; unsigned long now[2]; iss = sys$gettim(now); if (VMSERR(iss)) lib$signal(iss); if (a->function == UAL_SET || a->function == UAL_CLEAR) { if (a0->function == UAL_ACTIVE) { iss = sys$cantim(a0,PSL$C_USER); if (VMSERR(iss)) lib$signal(iss); iss = lib$subx(a0->remain, now, a->remain); if (VMSERR(iss)) lib$signal(iss); if (a->remain[1] & 0x80000000) a->remain[0] = a->remain[1] = 0; } if (a->function == UAL_SET) { a->function = a0->function; a0->function = UAL_ACTIVE; a0->repeat = a->repeat; if (a0->repeat) { a0->interval[0] = a->interval[0]; a0->interval[1] = a->interval[1]; } a0->delay[0] = a->delay[0]; a0->delay[1] = a->delay[1]; iss = lib$subx(now, a0->delay, a0->remain); if (VMSERR(iss)) lib$signal(iss); iss = sys$setimr(0,a0->delay,ualarm_AST,a0); if (VMSERR(iss)) lib$signal(iss); } else { a->function = a0->function; a0->function = UAL_NULL; } iss = sys$setef(alarm_ef); if (VMSERR(iss)) lib$signal(iss); } else if (a->function == UAL_ACTIVE) { if (a->repeat) { iss = lib$subx(now, a->interval, a->remain); if (VMSERR(iss)) lib$signal(iss); iss = sys$setimr(0,a->interval,ualarm_AST,a); if (VMSERR(iss)) lib$signal(iss); } else { a->function = UAL_NULL; } iss = sys$wake(0,0); if (VMSERR(iss)) lib$signal(iss); lib$signal(SS$_ASTFLT); } else { lib$signal(SS$_BADPARAM); } }
ctrlc_set(int4 dummy_param) { int4 status; msgtype message; error_def(ERR_LASTFILCMPLD); if (!IS_MCODE_RUNNING) { message.arg_cnt = 4; message.def_opts = message.new_opts = 0; message.msg_number = ERR_LASTFILCMPLD; message.fp_cnt = 2; message.fp[0].n = strlen(source_file_name); message.fp[1].cp = source_file_name; sys$putmsg(&message, 0, 0, 0); } else if (!outofband) { if (ctrlc_on) { status = sys$setef(efn_outofband); assert(SS$_WASCLR == status); if (status != SS$_WASCLR && status != SS$_WASSET) GTMASSERT; ctrap_action_is = 0; outofband = ctrlc; xfer_table[xf_linefetch] = op_fetchintrrpt; xfer_table[xf_linestart] = op_startintrrpt; xfer_table[xf_zbfetch] = op_fetchintrrpt; xfer_table[xf_zbstart] = op_startintrrpt; xfer_table[xf_forchk1] = op_startintrrpt; xfer_table[xf_forloop] = op_forintrrpt; sys$wake(0,0); } } }
pwr_tBoolean sect_Unlock ( pwr_tStatus *sts, sect_sHead *shp, sect_sMutex *mp ) { pwr_tStatus lsts = 1; #if defined(OS_ELN) ELN$UNLOCK_AREA((AREA)shp->area, *mp); #elif defined(OS_VMS) { sect_sMutexEntry *ep; pwr_tUInt32 i; /* When the entry is removed the resource becomes free if noone else is waiting... */ while ((i = _REMQHI(&mp->ownerroot, (void **)&ep)) == 1); if (i == 3) { lsts = LIB$_QUEWASEMP; } else { /* Reinsert entry in free list */ while (_INSQTI(ep, &mp->freeroot) == 1); if (i == 0) { /* Someone was waiting. */ ep = (sect_sMutexEntry *)( ((pwr_tUInt32)&mp->ownerroot) + mp->ownerroot.low /* flink */); lsts = sys$ascefc(64, &shp->namedsc, 0, 0); if (ODD(lsts)) lsts = sys$setef(ep->flag); } } } #elif defined(OS_LYNX) if (sem_post(mp) != 0) { perror("sect_Unlock: sem_signal "); lsts = 2; } #elif defined OS_POSIX if (posix_sem_post(mp) != 0) { perror("sect_Unlock: sem_signal "); lsts = 2; } #endif errh_ReturnOrBugcheck(ODD(lsts), sts, lsts, ""); }
/* Call back routine from xfer_set_handlers to complete outofband setup */ void jobinterrupt_set(int4 dummy_val) { int4 status; VMS_ONLY( status = sys$setef(efn_outofband); assert(SS$_WASCLR == status); if (SS$_WASCLR != status && SS$_WASSET != status) GTMASSERT; ) if (jobinterrupt != outofband)
void bck_ForceBackup ( void **context) { pwr_tInt32 sts; pwr_tTime *t; #ifdef OS_VMS $DESCRIPTOR (efcname, BCK_EFC_NAME); #endif /* * Initialize */ #ifdef OS_ELN if (!areas_mapped) { BCK_MAP_AREAS; areas_mapped = TRUE; } #endif /* * Build the context block (i.e. current time) */ if (context != NULL) { t = malloc (sizeof *t); time_GetTime(t); *context = t; } /* * Kick the backup processes */ #ifdef OS_ELN ker$signal (NULL, bck_forced_activation); #else sts = sys$ascefc (BCK_EFC, &efcname, 0, 0); if (EVEN (sts)) lib$signal (sts); sts = sys$setef (BCK_ACTIVATE); if (EVEN (sts)) lib$signal (sts); #endif } /* bck_ForceBackup */
void my1(int i) { printf("here1\n"); sys$setef(50); }