Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!nbires!hao!boulder!sunybcs!rutgers!bellcore!faline!ulysses!sfmag!sfsup!mpl From: mpl@sfsup.UUCP (M.P.Lindner) Newsgroups: comp.unix.questions Subject: Re: catching signals while writing to a tty-line Message-ID: <2021@sfsup.UUCP> Date: Thu, 10-Sep-87 16:21:22 EDT Article-I.D.: sfsup.2021 Posted: Thu Sep 10 16:21:22 1987 Date-Received: Sat, 12-Sep-87 15:49:50 EDT References: <589@euraiv1.UUCP> Organization: AT&T-IS, Summit N.J. USA Lines: 29 Summary: System V is broken In article <589@euraiv1.UUCP>, aiv@euraiv1.UUCP writes: > "when a signal that is to be caught occurs during a read, a write, ... > will be executed and the interrupted system call will return -1 to > the calling process with errno set to EINTR." > > (btw, I use System V release 2.0 on an AT&T 3B2/300) > > The problem is of course to detect the number of characters that has > already been written so that we don't send chars twice or not at all. > > Eelco van Asperen. Previous versions of UNIX(R) behaved as you'd like it to - write returned the number of characters actually written. However, in System V UNIX, the behaviour was modified to return -1. Consider that write *should* return -1 *on an error*. It seems that a signal you're expecting is now considered an error! As for a solution, there is none, other than to modify the kernel. This behaviour broke some of my programs and several applications I know of. It doesn't happen on *all* implementations of system V yet, but it will. Call your support rep and complain. I think this is something that should be changed back, but heck, I only *work* on UNIX, so they won't listen to me :{). Mike Lindner Disclaimer: The above opinions are contrary to those of my employer!