stream buffering operations
*stream, char *buf,
setlinebuf() functions are used to modify the
buffering of a stream. These functions are provided for compatibility with
legacy code. New code should use
Except for the lack of a return value, the
function is exactly equivalent to the call
setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
function is the same, except that the size of the buffer is up to the
caller, rather than being determined by the default
function is exactly equivalent to the call:
setvbuf(stream, NULL, _IOLBF, 0);
Upon successful completion, the
setlinebuf() function returns 0. If the request
cannot be honored, a non-zero value is returned, possibly setting
errno to indicate the error. The stream is not
modified in the error case.
setlinebuf() functions will fail if:
- The stream specified is not associated with a valid file descriptor.
fclose(3), fopen(3), fread(3), malloc(3), printf(3), puts(3), setvbuf(3)
setbuf() function conforms to
ISO/IEC 9899:1999 (“ISO C99”).
setlinebuf() functions are non-standard and should
not be used if portability is required.
setbuf() function first appeared in
Version 7 AT&T UNIX. The
setbuffer() function first appeared in
function first appeared in 4.2BSD.
setbuf() function usually uses a
suboptimal buffer size and should be avoided.