From owner-freebsd-bugs Thu Apr 20 08:22:52 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id IAA00295 for bugs-outgoing; Thu, 20 Apr 1995 08:22:52 -0700 Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id IAA00289 for ; Thu, 20 Apr 1995 08:22:51 -0700 Received: by halloran-eldar.lcs.mit.edu; id AA05095; Thu, 20 Apr 1995 11:18:32 -0400 Date: Thu, 20 Apr 1995 11:18:32 -0400 From: Garrett Wollman Message-Id: <9504201518.AA05095@halloran-eldar.lcs.mit.edu> To: rw@namu01.gwdg.de (Rainer Wittmann UMS) Cc: bugs@FreeBSD.org Subject: signal handling bug In-Reply-To: <9504201250.AA26059@namu01.gwdg.de> References: <9504201250.AA26059@namu01.gwdg.de> Sender: bugs-owner@FreeBSD.org Precedence: bulk < Any unix system, I know, except FreeBSD 2.0, behaves as follows, > [description deleted] Then you've never before used a 4BSD system. This is very long-standard BSD behavior (goes back to 1982 or earlier). > void SIGINT_handler(void) void SIGINT_handler(int) > { > signal(SIGINT, (void (*)(int))SIGINT_handler); Obviously you're used to using System V. Delete this line. > fprintf(stdout, "\nSIGINT received\n"); > } > char chr; > void main(void) > { > signal(SIGINT, (void (*)(int))SIGINT_handler); struct sigaction sa; sa.sa_handler = SIGINT_handler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sigaction(SIGINT, &sa, (struct sigaction *)0); > errno = 0; > read(0, &chr, 1); > if( errno == EINTR ) fprintf(stdout, "errno = EINTR\n"); > } -GAWollman -- Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ... wollman@lcs.mit.edu | Shashish is the bonding of hearts in spite of distance. Opinions not those of| It is a bond more powerful than absence. We like people MIT, LCS, ANA, or NSA| who like Shashish. - Claude McKenzie + Florent Vollant