Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!GYRE.UMD.EDU!chris From: chris@GYRE.UMD.EDU (Chris Torek) Newsgroups: comp.protocols.tcp-ip Subject: Re: Stdio over sockets Message-ID: <8906260417.AA25619@gyre.umd.edu> Date: 26 Jun 89 04:17:37 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 16 Sockets do not return errors from fstat calls. The result of an fstat is `the right thing'. What is probably happening is that your program(s) do(es) not use fflush. If you write to a terminal device, C (not Unix: it says to do it this way in the proposed C standard) stdio by default buffers text up to the first newline. Once you send a newline to a stdio stream, the text (including the newline) is printed immediately. Devices that are not terminals, however, get fully-buffered: text is not printed until a `sufficiently large amount' accumulates, or until the C program uses the fflush() stdio routine. Any good C book should explain this, at least if it was written after the first few drafts of the proposed standard were issued. Chris