From owner-freebsd-bugs Thu Apr 20 08:10:27 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id IAA29900 for bugs-outgoing; Thu, 20 Apr 1995 08:10:27 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id IAA29892 for ; Thu, 20 Apr 1995 08:10:05 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id BAA19958; Fri, 21 Apr 1995 01:06:53 +1000 Date: Fri, 21 Apr 1995 01:06:53 +1000 From: Bruce Evans Message-Id: <199504201506.BAA19958@godzilla.zeta.org.au> To: bugs@FreeBSD.org, rw@namu01.gwdg.de Subject: Re: signal handling bug Sender: bugs-owner@FreeBSD.org Precedence: bulk >Any unix system, I know, except FreeBSD 2.0, behaves as follows, >if a process is reading from a slow device like standard input from >a terminal. If this process receives a signal, for which a signal >handler was installed by the process, then immediately control >is tranferred to the signal handler (FreeBSD does this as well). >After the signal was serviced, the read system call is termianted >and errno is set to EINTR. Rather then doing this, FreeBSD completes >the read system call, as if no signal would have arrived. This >misbehavior breaks some of may programs. No matter, how often >it gets a signal. It NEVER sets errno to EINTR. This behavior >also contradicts the man page of read. This is standard BSD behaviour. See the man pages for signal(), sigaction() and siginterrupt() and references to the SA_RESTART sigaction flag in these man pages and in New code should normally use sigaction() and not the other functions. sigaction() is precisely defined by POSIX (as not having the SA_RESTART behaviour by default). The behaviour of signal() is system dependent. Bruce