Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: help needed on a unix system-call question Keywords: signal, system-call, read, unix v Message-ID: <1134@auspex.UUCP> Date: 8 Mar 89 19:40:52 GMT References: <2100@iitmax.IIT.EDU> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 14 >In my code I use a signal (SIGALRM), system-call, following which is a 'read' >system-call. The read is done on a tty-port. It is mentioned in the unix v >manual that 'read' will return -1 when interrupted by a signal. Is it poss- >ible to lose the partially read data by the 'read' system call, when the >signal was caught , even though I execute a 'read' again ? Note that I >am doing a 'read' on the tty-port. Assuming by "is it possible to lose the partially read data" you mean "if the 'read' blocks, and then transfers some data and blocks waiting for more data, and *then* gets interrupted by a signal, is the data it transferred more-or-less lost", the answer is "yes, and this happens under 4.xBSD as well". The problem is that, since you get a -1 back from the "read", rather than a count of the number of bytes read, you have no idea how much data was actually transferred.