Flushing buffers

You can use the library function fflush() to flush streams to the system. For more information about fflush(), see the 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 stream. If you call one z/OS® XL C program from another z/OS XL C program by using the ANSI system() function, all open streams are flushed before control is passed to the callee. A call to the POSIX system() function does not flush any streams to the system. For a POSIX system call, we recommend that you do a fflush() before the system call.