From owner-freebsd-questions Wed Jul 26 04:36:48 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id EAA16201 for questions-outgoing; Wed, 26 Jul 1995 04:36:48 -0700 Received: from pancake.remcomp.fr (pancake.remcomp.fr [194.51.30.1]) by freefall.cdrom.com (8.6.11/8.6.6) with SMTP id EAA16184 for ; Wed, 26 Jul 1995 04:36:34 -0700 Received: (from didier@localhost) by zapata.omnix.fr.org (8.6.9/8.6.9) id NAA06581 for questions@freebsd.org; Wed, 26 Jul 1995 13:04:24 +0200 From: Didier Derny Message-Id: <199507261104.NAA06581@zapata.omnix.fr.org> Subject: sleep / alarm conflict To: questions@freebsd.org Date: Wed, 26 Jul 1995 13:04:24 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 632 Sender: questions-owner@freebsd.org Precedence: bulk this sequence: #include #include #include #include #include #include #include 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 | +---------------------+