Am Sonntag, den 17.01.2016, 12:03 +0100 schrieb Markus Wichmann: > On Sun, Jan 17, 2016 at 09:59:52AM +0100, Jens Gustedt wrote: > > How about just using setvbuf as an indication that the user wants the > > buffer to be scrubbed? And so just zero it? > > > > I wouldn't expect setvbuf to be used in places that are performance > > critical, so an additional memset shouldn't do much harm, I think. > > > > That isn't the use everyone has for it. I routinely set stdout and stdin > to line buffered in my programs, because glibc sets the buffering mode > for these streams based on file type, and I want to be consistent in all > cases. And those applications can be performance critical. > > But then, I provide no buffer to these calls, so maybe differentiate on > that? Yes, sorry, I wasn't clear enough. This is what I meant, only scrub buffers if the user provides a buffer argument. Jens -- :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::