Open System Services System Calls Reference Manual (G06.28+)

System Functions (s and S) spt_getwx(2)
NAME
spt_getwx - Gets a word from an input 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_getwx (
FILE *stream
);
PARAMETERS
stream Points to the le structure of an open le.
DESCRIPTION
The spt_getwx() function is the thread-aware version of the getw() function.
The spt_getwx() function returns the next word (int) from the input specied by the stream
parameter and increments the associated le pointer, if dened, to point to the next int.
The spt_getw() function returns the constant EOF at the end of the le or when an error occurs.
Since EOF is a valid integer value, the feof() and ferror() functions can be used to check the
success of spt_getwx(). The spt_getwx() function assumes no special alignment in the le.
NOTES
The macro to map getw() to spt_getwx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK has been dened in the following manner before
including spthread.h:
#dene SPT_THREAD_AWARE_NONBLOCK
The alias to link getw() to spt_getwx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK has been dened in the following manner
before including spthread.h:
#dene SPT_THREAD_AWARE_PRAGMA_NONBLOCK
Because of possible differences in int length and byte ordering from one machine architecture to
another, les written using the spt_putwx( ) function are machine dependent and may not be
readable using getw() on a different type of processor.
RETURN VALUES
The spt_getwx() function returns the integer constant EOF at the end of the le or upon an error.
If the le 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 the following conditions occur, the spt_getwx() function sets errno to the correspond-
ing value:
[EAGAIN] The O_NONBLOCK ag is set for the underlying stream and the process would
be delayed by the read operation.
527186-005 Hewlett-Packard Company 7195