Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
spt_fwritex(2) OSS System Calls Reference Manual
NAME
spt_fwritex - Writes to an output 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>
size_t spt_fwritex (
const void ∗∗pointer,
size_t size,
size_t num_items,
FILE ∗∗stream
);
PARAMETERS
pointer Points to an array.
size Specifies the size of the variable type of the array pointed to by the pointer
parameter.
num_items Specifies the number of items of data.
stream Specifies the output stream.
DESCRIPTION
The spt_fwritex() function is the thread-aware version of the fwrite() function.
The spt_fwritex() function appends num_items of data of length size from the array pointed to
by the pointer parameter to the output stream.
The spt_fwritex() function stops writing bytes if an error condition is encountered on the stream,
or when the number of items of data specified by the num_items parameter have been written.
The spt_fwritex() function does not change the contents of the array pointed to by the pointer
parameter.
NOTES
The macro to map fwrite( ) to spt_fwritex() 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 fwrite() to spt_fwritex() 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_fwritex() function returns the number of items actually
transferred. If the num_items parameter is negative or 0 (zero), no characters are transferred, and
a value of 0 (zero) is returned. If a write error occurs, the error indicator for the stream is set, and
errno is set to indicate the error.
If the file descriptor underlying stream becomes invalid (is closed by another thread), 0 (zero) 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, 0 (zero) is returned with an errno value of [EINTR].
7−256 Hewlett-Packard Company 527186-023