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

fopen64(3) Guardian Native C Library Calls Reference Manual
NAME
fopen64 - 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 fopen64() function: fopen64_oss() and
fopen64_guardian(). These variants support the unique le-naming conventions and structures
of the OSS and Guardian le systems, respectively. In addition to supporting smaller
les, these
variants 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), respec-
tively.
An application can explicitly call this function when you compile the application using the
#dene _LARGEFILE64_SOURCE 1
feature test macro or an equivalent compiler command
option.
An application call to fopen( ) is automatically mapped to this function when you compile the
applciation using the #dene _FILE_OFFSET_BITS 64 feature test macro or an equivalent
compiler command option.
Explicit calls to the fopen64_oss() and fopen64_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 fopen64( ) OSS function and the fopen64_oss() function, refer to the
fopen64_oss(3) reference page. For a description of the fopen64( ) Guardian function and the
fopen64_guardian() function, see the fopen64_guardian(3) reference page.
NOTES
The le offset maximum for an OSS le is established when the le is opened. 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 fopen64_guardian(), or a function that calls this function, to open a
Guardian le with a le offset maximum of 4 gigabytes (a Guardian Format 1 le), the
le is automatically converted to a le that can grow to larger than 4 gigabytes (It is con-
verted to a Guardian Format 2 le).
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 gigabytes). 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.
230 Hewlett-Packard Company 527192-007