Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_fputwcx(2)
NAME
spt_fputwcx - Writes a wide character to a specified stream (thread-aware version)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
[#include <wchar.h>]
#include <spthread.h>
wint_t spt_fputwcx (
wint_t c,
FILE *stream
);
PARAMETERS
c Specifies the wide character to be written.
stream Points to the output data.
DESCRIPTION
The spt_fputwcx( ) function is the thread-aware version of the fputwc( ) function.
The spt_fputwcx( ) function converts the wchar_t specified by the c parameter to its equivalent
multibyte character and then writes the multibyte character to the stream parameter.
The spt_fputwcx( ) function works the same as spt_putwcx().
With the exception of stderr, output streams are, by default, buffered if they refer to files, or line
buffered if they refer to terminals. The standard error output stream, stderr, is unbuffered by
default, but using the freopen( ) function causes it to become buffered or line buffered. Use the
setbuf() function to change the stream’s buffering strategy.
NOTES
The macro to map fputwc() to spt_fputwcx() 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 fputwc( ) to spt_fputwcx() 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, this function returns the value written. If this function fails, it
returns the constant WEOF (wide-character end-of-file).
If the file descriptor underlying stream becomes invalid (is closed by another thread), WEOF 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, WEOF is returned with an errno value of [EINTR].
ERRORS
If any of these conditions occur, the spt_fputwcx( ) function sets errno to the corresponding
value.
[EAGAIN] The O_NONBLOCK flag is set for the file descriptor underlying stream and the
process would be delayed in the write operation.
527186-023 Hewlett-Packard Company 7−221