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

Guardian Native C Library Calls (f) fopen(3)
NAME
fopen - Opens a le 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
DESCRIPTION
The C run-time library supports two variants of the fopen() function: fopen_oss() and
fopen_guardian(). These variants support the unique le-naming conventions and structures of
the OSS and Guardian le systems, respectively. These variants support OSS
les that have a le |
offset maximum smaller than 2 gigabytes and Guardian les that have a le offset maximum |
smaller than 4 gigabytes (Guardian Format 1 les).
For the TNS C runtime library only, the header le maps calls to fopen() to the variant that
matches the target compilation environment. The target environment is set with the systype
pragma.
Explicit calls to the fopen_oss() and fopen_guardian() variants in source code are only made
when the behavior of one environment is desired from the other environment.
For a description of the fopen() OSS function and the fopen_oss( ) function, refer to the
fopen_oss(3) reference page. For a description of the fopen( ) Guardian function and the
fopen_guardian() function, see the fopen_guardian(3) reference page.
For a description of equivalent functions that support OSS les that have a le offset maximum |
larger than 2 gigabytes and Guardian les that have a le offset maximum larger than 4 gigabytes |
(Guardian Format 2 les), see the fopen64(3) reference page.
NOTES
The le offset maximum for an OSS le is established when the le is opened:
When you use fopen64_oss(), or a function that calls this function, to open an OSS le
that has a le offset maximum of 2 gigabytes, the le is automatically converted to a le
that can grow to larger than 2 gigabytes.
When you use fopen_oss() (and the call is not mapped to fopen64_oss()) to open a le
that is larger than 2 gigabytes, the le is treated like a small le. Subsequent operations,
such as read, write, and positioning operations, are subject to the same limits as when
accessing a le that has an offset maximum of 2 gigabytes.
The le offset maximum for an Guardian le is established when the le is opened. When you
use fopen_guardian() (and the call is not mapped to fopen64_guardian()) to open a Guardian
Format 2 le that has less than 4 gigabytes of data, the le is treated like a Guardian Format 1
le. Subsequent operations, such as read, write, and positioning operations, are subject to the
same limits as when accessing a Guardian Format 1 le (that has an offset maximum of 4 giga-
bytes). For a few functions, the OSS limit for small les of 2 gigabytes applies instead of the
Guardian limit for small les of 4 gigabytes, because le positions beyond 2 gigabytes cannot be
represented in the functionss data structures.
527192-007 Hewlett-Packard Company 229