Em ter., 15 de set. de 2020 às 14:54, Alvaro Herrera <
alvhe...@2ndquadrant.com> escreveu:

> I think you meant _IONBF instead of _IOFBF -- otherwise it's at odds
> with the comment you add.  But what is the justification for that
> addition?  I don't see us doing that anywhere else.
>
No.
_IOFBF *Full buffering:* On output, data is written once the buffer is full
(or flushed <http://www.cplusplus.com/fflush>). On Input, the buffer is
filled when an input operation is requested and the buffer is empty.
* _IONBF No buffering:* No buffer is used. Each I/O operation is written as
soon as possible. In this case, the *buffer* and *size* parameters are
ignored.
_IONBF ignores buffer and size.

Without setvbuf, fread uses an internal buffer, default 4096 bytes (OS
dependent).
If fread uses an internal buffer, then it needs a copy to the buffer
provided by the function.
setvbuf, does the same as read function low level, copies directly to the
final buffer.

regards,
Ranier Vilela

Reply via email to