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

Guardian Native C Library Calls (n - r) __ns_start_backup(3)
DESCRIPTION
The __ns_start_backup() function creates a backup process for the primary process.
This function can be called within Guardian processes only. When used in a program compiled
by the TNS compiler, this function can be called by Guardian modules (modules compiled for the
Guardian environment) only.
This function is called from the primary process to create and initialize the backup process. To
create the backup process, __ns_start_backup( ):
Starts the backup process with a call to the PROCESS_CREATE_ Guardian procedure.
Returns the process handle of the backup process, if the process started successfully.
To initialize the backup process, __ns_start_backup( ):
Sends to the backup process the same startup, ASSIGN, and PARAM messages received
by the primary process.
Calls __ns_fget_le_open_state() from the primary process to retrieve the le open
state information for the standard input, output, and error les.
Sends the le open state information from the primary process to the backup process
using the $RECEIVE facility or other methods. The backup process then performs a
backup open of the standard les using the le open state information received the pri-
mary process. The sync depth of the standard les is 1.
Only the standard les have backup opens performed. Other les opened by the primary process
must be explicitly opened in the backup process by calls to __ns_backup_fopen( ). The le
states of the standard les in the backup process are not automatically set to the corresponding
le states in the primary process. If operations have been performed on a standard le before
__ns_start_backup() has been called, you must call __ns_fget_le_state() and
__ns_fset_le_state( ) to retrieve and set the le state for the standard les.
Use the backup_hometerm and backup_debug_options parameters to help test and debug pro-
cess pairs.
Refer to the Guardian Programmers Guide for complete details on active backup programming
in C.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, -1 or a positive integer is
returned.
ERRORS
If an error occurs during process creation, the return value is a positive value that corresponds to
a PROCESS_CREATE_ error code. If you supplied an error_detail parameter, it contains the
PROCESS_CREATE_ error subcode. Refer to PROCESS_CREATE_ in the Guardian Pro-
cedure Calls Reference Manual for details.
If an error occurs during process initialization, the return value is -1 and errno is set to either of
the following:
Guardian file system error code
A le system error occurred.
[ENONSTOP] Any other error condition.
527192-005 Hewlett-Packard Company 519