Not a typewriter

Mikel Manitius mikel at codas.ATT.UUCP
Sat Jun 21 03:21:01 AEST 1986


>> If a read or write is interrupted by a signal, it will return 0 or
>> number of bytes written before the interrupt occured.  In this case
>> errno = 4, and no error code is returned from the system call.
>>
>>						 Mikel Manitius
> 
>I suspect you are misreading the documentation.  When a write system
>call is interrupted, it may either return a short count or return -1.
>Errno is set to 4 in the latter case.  I don't know of any version of
>UNIX in which read will return zero when interrupted.
>
> 				Kenneth Almquist

Yes, you are correct. I don't always trust the documentation, so I
rarely read it. I checked by writing a small C program, write does
indeed return -1 not 0, when the call is interrupted and no bytes
were read.
-- 
			Mikel Manitius @ AT&T-IS Altamonte Springs, FL
			...{seismo!akgua|ihnp4|cbosgd}!codas!mikel.ATT.UUCP



More information about the Comp.unix mailing list