

setbuf()                      STDIO                      setbuf()




Set alternative stream buffers

#include <stdio.h>
vvooiidd sseettbbuuff(_f_p, _b_u_f_f_e_r) FFIILLEE *_f_p; cchhaarr *_b_u_f_f_e_r;

The  standard I/O  library STDIO  automatically buffers  all data
read and  written in  streams, with  the exception of  streams to
terminal  devices.  STDIO  normally uses  malloc to  allocate the
buffer, which  is a char array BUFSIZ  characters long; BUFSIZ is
defined in the header file stdio.h.

setbuf's arguments  are the file  stream fp and the  buffer to be
associated with the stream.   The call should be issued after the
stream has  been opened, but  before any input  or output request
has been  issued.  The  _b_u_f_f_e_r passed to  setbuf may be  NULL, in
which case  the stream will  be unbuffered, or  contains at least
BUFSIZ bytes.

setbuf returns nothing.

***** See Also *****

fopen(), malloc(), STDIO

































COHERENT Lexicon                                           Page 1


