Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (n - r) __ns_backup_fopen64(3)
NAME
__ns_backup_fopen64 - Performs a backup open for a file opened in the primary process
LIBRARY
G-series native nonPIC Guardian processes: $SYSTEM.SYSTEM.CRTLNS
G-series native PIC Guardian processes: $SYSTEM.SYSTEM.CRTLNS2
H-series native Guardian processes: $SYSTEM.ZDLLnnn.CRTLNSE
SYNOPSIS
#include <crtlns.h>
FILE *__ns_backup_fopen64 (
__ns_std_io_file_open_state *file_open_state);
PARAMETERS
file_open_state Points to a variable that stores the file open state information.
DESCRIPTION
The __ns_backup_fopen64() function is similar to the __ns_backup_fopen( ) function except
that, in addition to supporting smaller files, the __ns_backup_fopen64() function supports Guar-
dian files larger than approximately 4 gigabytes.
An application can explicitly call this 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 __ns_backup_fopen( ) is automatically mapped to this function when you
use the #define _FILE_OFFSET_BITS 64 feature test macro or an equivalent compiler com-
mand option to compile the application.
For active backup process pairs, the __ns_backup_fopen64() function performs a backup open
for a file that was opened in the primary process using ANSI-model I/O.
You can call this function within Guardian processes only. When used in a program compiled by
the TNS compiler, only Guardian modules (modules compiled for the Guardian environment) can
call this function.
This function is called from the backup process to perform a backup open of the file. Before cal-
ling this function, the primary process must first call the __ns_fget_file_open_state() function to
retrieve the file open state information. The primary process can use the $RECEIVE facility or
other methods to send the state information to the backup processor. The primary process must
send the variable containing the file-state information, not the pointer to the variable, to the
backup process.
The backup file open does not perform any fopen64( ) function access_mode actions that create
or truncate a file. File-creation and truncation actions are not necessary because the initial
fopen64( ) call in the primary process performed these actions.
The only meaningful operations on file open state information are:
Retrieving with the __ns_fget_file_open_state() function
Starting a backup file open with the __ns_backup_fopen64() function
Copying with an assignment statement or a copy function from the C run-time library
The results of manipulating components of the file open state information are undefined.
For complete details on active backup programming in C, see the Guardian Programmer’s
Guide.
527192-018 Hewlett-Packard Company 525