Guardian C Library Calls Reference Manual

__ns_fopen_special (supplementary)
3-130 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
For output streams, a call to a write function in user code might leave a partially
filled, unflushed buffer. To ensure that the buffer is flushed, you can:
Perform a flush operation, such as a call to the fflush function, prior to calling the
__ns_fget_file_state function.
Ignore the effects of unflushed buffers, if the unflushed buffer contents are not
critical to the application.
Disable buffering with the setvbuf or setnbuf function.
In addition to either the CLARGE or CWIDE library file, you must bind the
CNONSTOP library file into programs that use this function.
This function can only be used in the Guardian environment.
Refer to the Guardian Programmer’s Guide for complete details on fault-tolerant
programming in C.
__ns_fopen_special (supplementary)
The __ns_fopen_special function opens a file for ANSI-model I/O and allows a sync
depth to be specified.
file_name
points to a string containing a valid file name.
*access_mode
points to a string that specifies how you want to access the file. The possible values
for *access_mode are described under “Usage Guidelines.
sync_depth
specifies the number of nonretryable write requests whose completion must be
remembered by the file system. sync_depth must conform to the operating system
limit of a value between zero and fifteen.
Return Value
points to the FILE structure denoting the opened file if the operation is successful;
otherwise, the function returns the pointer value NULL.
#include <nonstoph>
FILE *__ns_open_special(
char *file_name,
char *access_mode,
short sync_depth);