[comp.os.minix] alarm

mdm@cocktrice.uucp (Mike Mitchell) (12/29/90)

Is anyone aware of a problem with a routine installed as an alarm which
in turn calls a longjmp()? Below is a piece of code which should illustrate
what my question is about:

jmp_buf buf;

timeout() { printf("Timer expired\n"); longjmp(buf, 1); }

int routine() {

	if (setjmp(buf))
		return -1;

	signal(SIGALRM, timeout)

	alarm(10);

	/* TIMED CODE */

	alarm(0);
}

This is an over simplification of what I am trying to attempt, however
the problem demonstrated is that the printf() function in the timout
routine is never called. When using the 'ps' key to note the status of
the program, I do not see the system or user time increment. I could
be chasing the wrong problem here too...

This is with Minix/386 and Bruce Evans compiler.

Any insights? Thank you for your time and effort.

-- 
Mike Mitchell                             Mail: ...!uunet!dmk3b1!cocktrice!mdm
2020 Calle Lorca #43                                   Phone: (505) 471-7639 H
Santa Fe, New Mexico 87505                                    (505) 473-4482 W