Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!think!mit-eddie!genrad!decvax!mcnc!rti-sel!dg_rtp!meissner From: meissner@dg_rtp.UUCP (Michael Meissner) Newsgroups: net.unix Subject: Re: why is fprintf(stderr,) slow? Message-ID: <549@dg_rtp.UUCP> Date: Mon, 1-Sep-86 13:04:29 EDT Article-I.D.: dg_rtp.549 Posted: Mon Sep 1 13:04:29 1986 Date-Received: Wed, 3-Sep-86 20:49:21 EDT References: <633@hropus.UUCP> <1480@poseidon.UUCP> <7074@utzoo.UUCP> <338@chronon.chronon.UUCP> Reply-To: meissner@dg_rtp.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 19 Summary: Setvbuf on System V.2 and ANSI X3J11 In article <338@chronon.chronon.UUCP> eric@chronon.UUCP (Eric Black) writes: > >Of course, the reason that it was made per character is to make sure that >the error output in fact gets out, and is not lost in stdio buffering somewhere >when an errant program suddenly gives up the ghost. On BSD systems, >at least, you can change this with the setlinebuf(3S) call, to make >stderr use buffering. Nowadays, with buffered stdio output less likely >to get lost (?), perhaps it is too bad that the default is still >to make a system call per character, rather than per call, but... > >On non-BSD systems you're stuck, as far as I know. On System V.2, V.3, and the ANSI X3J11 draft you can use setvbuf (which allows to set both the buffersize and a choice between no/line/full buffering). Also, I believe a pure System V.2 system buffers per call to *printf instead of per character (but I'm not sure). Michael Meissner, Data General ...{ decvax, ucbvax }!mcnc!rti-sel!dg_rtp!meissner