From owner-freebsd-hackers Fri Nov 30 11:54:40 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from search.sparks.net (d-207-5-180-136.gwi.net [207.5.180.136]) by hub.freebsd.org (Postfix) with ESMTP id 16AC937B61E for ; Fri, 30 Nov 2001 11:54:18 -0800 (PST) Received: by search.sparks.net (Postfix, from userid 100) id BC06FD995; Fri, 30 Nov 2001 14:53:24 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by search.sparks.net (Postfix) with ESMTP id B01C9D993 for ; Fri, 30 Nov 2001 14:53:24 -0500 (EST) Date: Fri, 30 Nov 2001 14:53:24 -0500 (EST) From: David Miller To: freebsd-hackers@freebsd.org Subject: [OT] alarm() question Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Apologies for this being more C than freebsd, but I did say OT in the subject... In the most basic use of an alarm, like this: #include #include #include sig_t signal(int sig, sig_t func); static void bzzt() { printf("In routine bzzt now, timer expired after 3 seconds\n"); } main() { signal(SIGALRM, bzzt); alarm(3); system("/usr/bin/host -t soa 111.0.12.in-addr.arpa"); printf("Done\n"); } Why does the alarm go off but not interrupt the system call? bzzt() is executed, but the program doesn't print Done and exit for a minute plus. Pointers to FM to RT welcome. Thanks, --- David To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message