Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: stdio on SYSV vrs BSD Message-ID: <24197@mimsy.umd.edu> Date: 5 May 90 05:07:10 GMT References: <558@venice.SEDD.TRW.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 21 In article <558@venice.SEDD.TRW.COM> waldorf@venice.SEDD.TRW.COM (Jerry Waldorf) writes: >In the file /usr/include/stdio.h on a BSD box, there is a defined: >#define _IOSTRG 0100 >What exactly is this used for? Almost nothing. It is set in exactly two places (sprintf and sscanf) and tested in one (_filbuf). In particular, it is not tested in _flsbuf, so that char dst[32800], src[32768]; int i; for (i=0; i<32767; i++) src[i] = 'x'; src[32767] = 0; sprintf(dst, "too much: %s", src); calls write() on a random file descriptor. All _IOSTRG really does is keep _filbuf() from reading from a random file descriptor. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris