Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getw(3) Guardian Native C Library Calls Reference Manual
NAME
getw - Gets a word from an input stream
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdio.h>
int getw(
FILE *stream);
PARAMETERS
stream Points to the file structure of an open file.
DESCRIPTION
The getw() function returns the next word (int) from the input specified by the stream parameter
and increments the associated file pointer, if defined, to point to the next int.
The getw() function returns the constant EOF at the end of the file 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 getw(). The getw() function assumes no special alignment in the file.
NOTES
Because of possible differences in int length and byte ordering from one machine architecture to
another, files written using the putw() function are machine dependent and may not be readable
using getw() on a different type of processor.
RETURN VALUES
The getw() function returns the integer constant EOF at the end of the file or upon an error.
ERRORS
If any of the following conditions occur, the getw() function sets errno to the corresponding
value:
[EAGAIN] The O_NONBLOCK flag is set for the underlying stream and the process would
be delayed by the read operation.
[EBADF] The file descriptor underlying the stream is not a valid file descriptor or is not
open for reading.
[EINTR] The read operation was interrupted by a signal which was caught and no data
was transferred.
[ENXIO] A request was made on a non-existent device, or the request was outside the
capabilities of the device.
[EIO] The call is attempting to read from the process’s controlling terminal and either
the process is ignoring or blocking the SIGTTIN signal or the process group is
orphaned.
[ENOMEM] Insufficient memory is available for the operation.
370 Hewlett-Packard Company 527192-018