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

#include <tal.h>
#include <cextdecs.h(FILE_OPEN_, READX)>
_cc_status CC;
...
retcode = FILE_OPEN_(pathname, , &filenum, 1, , , , 040);
...
CC = READX(filenum, buffer, 1024);
if (_status_eq(CC)) {
...
} else
...
The syntax of a Guardian procedure call determines whether a parameter is required or optional.
Refer to the Guardian Procedure Calls Reference Manual and the Guardian Programmer’s Guide
for more information on using Guardian procedures. Refer to the Open System Services
Programmer’s Guide for details on which Guardian procedures can be called from C programs
running in the OSS environment.
Environment-Specific I/O Routines
Environment-specific I/O routines provide interoperability between OSS files and Guardian files.
Both the OSS and the Guardian variants of these functions are available;for example,
rename_oss() and rename_guardian(). These routines are discussed in “Environment-Specific
Functions” (page 74):
Opens a stream.fopen() fopen64()
Opens a stream.freopen() freopen64()
Removes a file.remove()
Renames a file or directory.rename()
Creates a temporary file.tmpfile()
Creates a name for a temporary file.tmpnam()
Large File Aware Functions
For J-series RVUs, H06.06 and later H-series RVUs, and G06.29 and later G-series RVUS, 64-bit
functions are available that support smaller files and OSS files larger than approximately 2
gigabytes. These functions are called large file aware functions. Typically, these 64-bit functions
include the number 64 in the name of the function.
These APIs are HP extensions function, but they are based on the Adding Support for Arbitrary
File Sizes to the Single Unix Specification, X/Open Large File Summit (LFS) submission, version
1.5 (March 20, 1996).
An application can explicitly call a 64-bit function when you use the
#define _LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command
option to compile the application.
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.
If a small file is accessed using a 64-bit function:
The file is automatically converted to use an underlying Guardian file format of Format 2.
The file no longer has a size limit of approximately 2 gigabytes. It can grow to the size limit
for large files.
The large file aware OSS APIs are:
creat64()
open64()
132 Porting UNIX Applications to the OSS Environment