tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: stdio buffering extension



On Thu, Jul 16, 2015 at 02:05:23PM -0400, Mouse wrote:
> > OTOH if a program is writing binary data (maybe using fwrite() not
> > fprintf()) then block buffering is more likely to be appropriate.
> 
> This actually raises an interesting question.  Maybe the buffering
> should depend on the call used?  (f)fprintf, for example, might want to
> line-buffer, but fwrite block-buffer?

It should, but the design of the stdio implementation doesn't allow that
easily. More precisely, any high-level operation should should ideally
result in one call to read or write on the system call level. That's
currently not possible for the lack of an atomic read-until-delimiter
support from the kernel, but that might actually be a good addition.

Joerg


Home | Main Index | Thread Index | Old Index