Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!amdcad!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: catching signals while writing to a tty-line Message-ID: <27275@sun.uucp> Date: Fri, 4-Sep-87 14:42:29 EDT Article-I.D.: sun.27275 Posted: Fri Sep 4 14:42:29 1987 Date-Received: Sat, 5-Sep-87 20:36:35 EDT References: <589@euraiv1.UUCP> Sender: news@sun.uucp Lines: 18 Keywords: signal;slow i/o > 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. It can't be done. If you had S5R3 you could hold off the signal while you're writing, but I infer from your description that the whole point of the signal *is* to interrupt the "write". 4BSD restartable system calls won't help, either, as only "write"s that have written nothing are restarted; if the "write" has transferred data, it is interrupted in the standard UNIX fashion. The current IEEE POSIX draft specifies that an implementation *may* make "write" return the number of bytes written if it is interrupted after having transferred some data; however, it does not require this. Some implementations may provide this, but I don't know if any do now. Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com