Flushing buffers

You can use the library function fflush() to flush streams to the system. For more information about fflush(), see z/OS XL C/C++ Runtime Library Reference.

The action taken by the fflush() library function depends on the buffering mode associated with the stream and the type of streams. If you call one z/OS® XL C/C++ program from another z/OS XL C/C++ program by using the ANSI system() function, all open streams are flushed before control is passed to the callee, and again before control is returned to the caller. If you are running with POSIX(ON), a call to the POSIX system() function does not flush any streams to the system.