Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!unmvax!bbx!cocktrice!mdm From: mdm@cocktrice.uucp (Mike Mitchell) Newsgroups: comp.os.minix Subject: alarm() function calling longjmp() -- problems? Message-ID: <1990Dec28.231159.4632@cocktrice.uucp> Date: 28 Dec 90 23:11:59 GMT Organization: Mike's Playground, Santa Fe, New Mexico Lines: 36 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