Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
spt_fgetcx(2) OSS System Calls Reference Manual
NAME
spt_fgetcx - Gets a character from a specified 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_fgetcx (
FILE *stream
);
PARAMETERS
stream Points to the file structure of an open file.
DESCRIPTION
The spt_fgetcx( ) function is the thread-aware version of the fgetc() function.
The spt_fgetcx( ) function returns the next byte from the input specified by the stream parameter
and moves the file pointer, if defined, ahead one byte in stream.
NOTES
The macro to map fgetc() to spt_fgetcx() 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 fgetc() to spt_fgetcx( ) 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
The spt_fgetcx( ) function returns a character if successful. It returns the integer constant EOF
at the end of the file or upon an error. The function sets errno when an error is encountered.
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_fgetcx( ) function sets errno to the corresponding value:
[EAGAIN] The O_NONBLOCK flag is set for the underlying input stream and the process
would be delayed by the read operation.
[EBADF] The file descriptor underlying the input stream is not a valid file descriptor or is
not open for reading.
[EINTR] The read operation was interrupted by a signal that was caught and no data was
transferred.
7−180 Hewlett-Packard Company 527186-023