Date: Fri, 28 Jul 1995 09:25:23 +0200 (MET DST) From: Didier Derny <didier@omnix.fr.org> To: freebsd-questions@freebsd.org Subject: Re: sleep / alarm conflict Message-ID: <199507280725.JAA12056@zapata.omnix.fr.org>
next in thread | raw e-mail | index | archive | help
this sequence: #include <stdio.h> #include <sys/types.h> #include <setjmp.h> #include <limits.h> #include <float.h> #include <fcntl.h> #include <signal.h> static jmp_buf jumpenv; ReadLineAlarm() { signal(SIGALRM, SIG_IGN); alarm(0); fprintf(stderr, "alarm signal caught\n"); longjmp(jumpenv, 1); } main() { signal(SIGALRM, ReadLineAlarm); if (setjmp(jumpenv) != 0) return; alarm(2); for (;;) sleep(1); } never end. Is it normal or a bug. this sequence works if alarm is replaced by an infinite loop. +---------------------+ | Didier Derny | | didier@omnix.fr.org | +---------------------+
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507280725.JAA12056>