Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

For the near future HP expects that large files will be rare instead of commonplace, so the OSS
implementation of large file support:
Ensures that existing applications, without modification, can continue to support small files.
Enables you to either choose a compilation environment that allows you to use the standard
POSIX APIs in your code to ease future portability or to choose a compilation environment
that allows you to explicitly call the 64-bit large file aware function calls.
Large File Safe and Large File Aware Applications
An application that is large OSS file aware (LFA) can process OSS files larger than approximately
2 gigabytes with the same functionality as processing OSS files smaller than approximately
2 gigabytes. Such an application can handle large files as input and generate large files as output.
Applications that are large file aware can also process small files.
The Open System Services Programmer’s Guide lists the APIs that are large file aware.
An application that is large OSS file safe (LFS) causes no data loss or corruption when it encounters
an OSS file larger than approximately 2 gigabytes. Although it cannot process OSS files larger
than approximately 2 gigabytes, it has the appropriate logic to handle errors or warnings detected
during file manipulation operations and fail gracefully.
The Open System Services Programmer’s Guide lists the APIs that are large file safe.
Compilation Environments and Large File Support
There are three compilation environments:
Regular compilation environment
Transitional compilation environment
Large file compilation environment
Using regular compilation environment is sufficient to make an application large file safe, but to
make an application large file aware you must choose either the transitional or the large file
composition environment.
An application call to interface() is automatically mapped to the interface64()
function when you use the #define _FILE_OFFSET_BITS 64 feature test macro or an
equivalent compiler command option to compile the application. A module is considered to
be compiled in a large file compilation environment if it is compiled using this method.
Choosing a Compilation Environment
Choosing the Regular Compilation Environment
Using this compilation environment is sufficient to make an application large file safe, but does
not enable support for large OSS files.
A module is considered to be compiled in a regular compilation environment if it is compiled on
a system running G06.29 or a later G-series RVU, or H06.06 or a later H-series RVUs, or a J-series
RVU, and it is not compiled using either of the feature test macros. Using this compilation
environment is sufficient to make an application large file safe.
Choosing the Transitional Compilation Environment
One way to enable large file support is to use the transitional compilation environment. A module
is considered to be compiled in a transitional compilation environment when use the #define
_LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command option to
compile the application, which allows the application to explicitly call the 64-bit version of a
function.
Large File Safe and Large File Aware Applications 191