Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) spt_fushx(2)
NAME
spt_fflushx - Flushes a stream (thread-aware version)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <stdio.h>]
#include <spthread.h>
int spt_fflushx(
FILE *stream
);
PARAMETERS
stream Specifies the output or update stream.
DESCRIPTION
The spt_fushx() function is the thread-aware version of the fush( ) function.
The spt_fushx() function writes any buffered data for the stream specified by the stream param-
eter and leaves the stream open. If stream is a null pointer, the spt_fushx() function performs
this flushing action on all streams for which the behavior was previously defined. The st_ctime
and st_mtime fields of the underlying file are marked for update.
NOTES
The macro to map fflush() to spt_fflushx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK has been defined in the following manner before
including spthread.h:
#define SPT_THREAD_AWARE_NONBLOCK
The alias to link fush() to spt_fflushx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK has been defined in the following manner
before including spthread.h:
#define SPT_THREAD_AWARE_PRAGMA_NONBLOCK
RETURN VALUES
Upon successful completion, the spt_fflushx() function returns a value of 0 (zero). Otherwise,
EOF is returned, and errno is set to indicate the error.
If the file descriptor underlying stream becomes invalid (is closed by another thread), EOF is
returned with an errno value of [EBADF]. If a signal is received via the pthread_kill() function
and is not blocked, ignored, or handled, EOF is returned with an errno value of [EINTR].
ERRORS
If any of these conditions occur, the spt_fushx() function sets errno to the value that
corresponds to the condition.
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor underlying stream and the
process would be delayed in the write operation.
[EBADF] The file descriptor underlying the stream parameter is not valid.
527186-023 Hewlett-Packard Company 7177