Guardian C Library Calls Reference Manual
setnbuf (supplementary)
3-162 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
setnbuf (supplementary)
The setnbuf function disables buffering for a file opened for ANSI I/O. For an equivalent
ANSI-standard function, refer to “setbuf” on page 3-158.
stream
denotes a file opened for ANSI I/O.
Return Value
none.
Usage Guidelines
•
Once you call setnbuf, which disables buffering, all input and output operations on
the specified file generate immediate I/O requests.
Example
In this example, the setnbuf function disables buffering for the file $a.b.c:
#include <stdioh>
FILE *fp;
fp = fopen("$a.b.c ", "r+");
/* ... */
setnbuf(fp);
setvbuf
The setvbuf function attaches a user-supplied buffer or disables buffering to a file
opened for ANSI I/O.
stream
denotes a file opened for ANSI I/O.
#include <stdioh>
void setnbuf(FILE *stream);
#include <stdioh>
int setvbuf(FILE *stream, char *buf, int mode, size_t size);