C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

$RECEIVE
When you are accessing $RECEIVE, HP recommends that you use Guardian system procedures,
rather than the ANSI or alternate I/O C functions, for:
Performing interprocess communication
Opening $RECEIVE and reading or replying to system messages
ANSI-Model I/O
As mentioned earlier, the ANSI-model I/O functions use FILE pointers to identify files. To create
such a pointer, you make a declaration of the form:
FILE identifier;
The functions that open a physical file for ANSI-model I/O return a FILE pointer that denotes the
newly opened file. From this point on, you use that FILE pointer to direct I/O requests to the physical
file.
FILE pointers point to structures that are internal to the run-time library and contain various types
of information regarding the file and its status. Several of the ANSI-model I/O functions offer access
to various members of a FILE structure. These members include the file-position indicator and the
file-error indicator.
Alternate-Model I/O
As mentioned earlier, the alternate-model I/O functions use file descriptors to identify files. The
alternate-model I/O functions are not available in standard ISO/ANSI C. In the Guardian TNS
environment, alternate-model I/O functions are defined by HP. In all other environments,
alternate-model I/O functions are defined by the XPG4 specification.
The arguments required by the function file descriptors are simply variables of type int, so to create
one you make a declaration of the form:
int identifier;
The functions that open a physical file for alternate-model I/O return a file descriptor that denotes
the newly opened file. You then use that file descriptor to direct I/O requests to the physical file.
Note that file descriptors are different from file numbers:
Alternate-model I/O functions use file descriptors to identify files
Guardian system procedures use file numbers to identify files
Use errno to determine whether there is an error when I/O is performed using the alternate-model
I/O functions. The I/O error handling for the alternate model is an HP extension not specified in
the ISO/ANSI C standard.
The header file errnoh or errno.h declares the variable errno and several object-like macros
that are used to report errors. Include the errnoh header file, set errno to zero and call the
alternate-model I/O function. If the function fails, errno contains the error code.
Mathematical Functions
This subsection describes mathematical functions available on HP NonStop systems before the
G06.06 release, and available after the G06.06 release if you specify Tandem floating-point
format. Additional mathematical functions that are available with IEEE floating-point format are
described in IEEE Floating-Point Arithmetic (page 75).
The C run-time libraries provide mathematical functions, such as cos() and exp(), defined in
the ISO/ANSI C standard and XPG4 specification. For specific conditions, these standards define
the actions taken by a mathematical function. These actions are specified as either required or
optional.
74 Using the C Run-Time Library