TNS/R Native Application Migration Guide
C and C++ Migration Tasks
TNS/R Native Application Migration Guide—523745-001
3-14
Changing Programs That Use Guardian and OSS
Environment Interoperability
Changing Programs That Use Guardian and
OSS Environment Interoperability
Because of differences in the Guardian and OSS file systems, six functions require
environment-specific parameters: fopen(), freopen(), remove(), rename(),
tmpnam(), and tmpfile(). Each of these base functions has a Guardian variant and
an OSS variant, such as fopen_guardian() and fopen_oss().
In the TNS environment, the environment-specific parameters expected by these base
functions are determined at compile time. That is, the functions expect Guardian
parameters if called from a module compiled with SYSTYPE GUARDIAN and expect
OSS parameters if called from a module compiled with SYSTYPE OSS. The run-time
environment of the process the module is bound into does not affect the call. For
example, an fopen() call in a module compiled with SYSTYPE GUARDIAN and
bound into a program that runs as an OSS process expects a Guardian parameter at
run time.
In the native environment, the environment-specific parameters expected by these
base functions are determined at run time. That is, the functions expect Guardian
parameters if called from a Guardian process and OSS parameters if called from an
OSS process. The compilation environment is ignored. This change was made to
simplify and enhance the usability of the Guardian and OSS environment
interoperability model.
In modules compiled with SYSTYPE OSS and linked into a program that runs as a
Guardian process, replace calls to the base function with calls to the _oss variant.
Likewise, in modules compiled with SYSTYPE GUARDIAN and linked into a program
that runs as an OSS process, replace calls to the base function with calls to the