示例#1
0
void 
prim_ispidp(PRIM_PROTOTYPE)
{
    /* i -- i */
    CHECKOP(1);
    oper1 = POP();
    if (oper1->type != PROG_INTEGER)
	abort_interp("Non-integer argument (1)");
    if (oper1->data.number == fr->pid) {
	result = 1;
    } else {
        result = in_timequeue(oper1->data.number);
    }
    CLEAR(oper1);
    PushInt(result);
}
示例#2
0
const char *
mfn_kill(MFUNARGS)
{
    int i = atoi(argv[0]);
    if (i > 0) {
	if (in_timequeue(i)) {
	    if (!control_process(perms, i)) {
		ABORT_MPI("KILL",NOPERM_MESG);
	    }
	    i = dequeue_process(i);
	} else {
	    i = 0;
	}
    } else if (i == 0) {
	i = dequeue_prog(perms, 0);
    } else {
	ABORT_MPI("KILL","Invalid process ID");
    }
    sprintf(buf, "%d", i);
    return buf;
}