Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

Guardian Native C Library Calls (g - i) getw(3)
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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdio.h>
int getw(
FILE *stream);
PARAMETERS
stream Points to the le structure of an open le.
DESCRIPTION
The getw() 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 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 getw(). The getw() function assumes no special alignment in the le.
NOTES
Because of possible differences in int length and byte ordering from one machine architecture to
another, les 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 le 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 ag is set for the underlying stream and the process would
be delayed by the read operation.
[EBADF] The le descriptor underlying the stream is not a valid le 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 processs controlling terminal and either
the process is ignoring or blocking the SIGTTIN signal or the process group is
orphaned.
[ENOMEM] Insufcient memory is available for the operation.
527192-007 Hewlett-Packard Company 341