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

System Functions (s and S) spt_getcx(2)
NAME
spt_getcx - Gets a character from a specied 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_getcx (
FILE stream
);
PARAMETERS
stream Points to the FILE structure of an open le.
DESCRIPTION
The spt_getcx() function is the thread-aware version of the getc() function.
The spt_getcx() function returns the next byte from the input specied by the stream parameter
and moves the le pointer, if dened, ahead one byte in stream.
NOTES
The macro to map getc() to spt_getcx( ) 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 getc() to spt_getcx() 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
The spt_getcx() function might be a macro (depending on the compile-time denitions used in
the source). Consequently, you cannot use this interface where a function is necessary; for
example, a subroutine pointer cannot point to it. In addition, spt_getcx() does not work correctly
with a stream parameter that has side effects. In particular, the following does not work:
spt_getcx(*f++)
When a function is necessary, use the spt_fgetcx() function instead.
RETURN VALUES
This function and macro:
Returns a character if successful.
Returns the integer constant EOF at the end of the le or upon an error.
Sets errno when an error is encountered.
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].
527186-007 Hewlett-Packard Company 7185