06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

setvbuf pREPC+ <strong>System</strong> <strong>Calls</strong><br />

setvbuf Changes a stream’s buffering characteristics.<br />

#include <br />

#include <br />

int setvbuf(<br />

FILE *stream, /* stream pointer */<br />

char *buf, /* I/O buffer */<br />

int mode, /* access mode */<br />

size_t size /* buffer size */<br />

)<br />

Description<br />

Arguments<br />

The setvbuf() function can be used to change either the buffer associated with a<br />

stream, the size of a stream's buffer, or the method employed for buffering the<br />

stream's data.<br />

setvbuf() must be called after the specified stream has been opened, but prior to<br />

reading or writing the file. If setbuf() is called after a read or write operation, it<br />

has no effect.<br />

pREPC+ allocates a buffer automatically if the buf parameter is NULL and a nonzero<br />

size is specified.<br />

stream Points to an open pREPC+ stream.<br />

buf Points to the new buffer to be associated with the stream.<br />

mode Defines the method employed for buffering data. The possible modes<br />

are as follows:<br />

_IO_FBF Input/output is fully buffered.<br />

_IO_LBF Input/output is line buffered.<br />

_IO_NBF Input/output is not buffered.<br />

3-136 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!