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

tables in the Open System Services Programmer’s Guide for more information on using OSS
functions for accessing Guardian processes.
For specific information on a particular function, refer to the online reference pages, the Open
System Services Library Calls Reference Manual or the Open System Services System Calls Reference
Manual.
Process-Termination Interoperability
When a process calls PROCESS_SPAWN_ to create a process, the parent process is treated as a
Guardian process, regardless of whether the caller is an OSS or Guardian process. In this case,
the parent process receives process-termination notification through Guardian system messages
(instead of the SIGCHLD signal, which is normal notification for OSS processes). The parent process
reads system messages from $RECEIVE, which is a special file through which a process receives
system messages or messages from other processes.
The exit() and _exit() function calls can be issued by either an OSS process or a Guardian
process. If the parent process is an OSS process, the normal SIGCHLD signal is sent to notify the
parent process of the death of one of its child processes. Child processes of a terminated process
are assigned a parent process ID of 1. For more information about the exit function, refer to the
exit(3) reference page either online or in the Open System Services Library Calls Reference
Manual. For more information about the _exit function, refer to the _exit(2) reference page
either online or in the Open System Services System Calls Reference Manual.
File Interoperability
You access OSS files in the OSS environment as you would access UNIX files. The OSS environment
also allows you to access a limited set of files in the Guardian environment, which means that you
can create applications for NonStop systems that use data in Guardian files and that take advantage
of OSS portability and other OSS features.
Use OSS file system functions to manipulate OSS files if you want your program to be portable to
other UNIX environments. However, it may be necessary to manipulate Guardian files using the
OSS API, or to manipulate OSS files using the Guardian API.
The FILENAME_TO_PATHNAME_ and PATHNAME_TO_FILENAME_ Guardian mapping procedures
provide the link between OSS pathnames and Guardian filenames. These two procedures are
discussed more in “Guardian Procedure Calls for Interoperability” (page 129).
Applications running on systems that do not include support for OSS large files can use either OSS
or Guardian APIs to open any OSS file smaller than approximately 2 gigabytes, even if that file
is on a system that includes support for OSS large files.
Accessing Files From the OSS API
OSS functions are tailored to the OSS environment and work more efficiently than Guardian
procedures on OSS files.
Accessing OSS Files
HP does not support OSS opens of OSS files larger than approximately 2 gigabytes on systems
that do not include support for OSS large files.
Accessing Guardian Files
You can access four types of Guardian files with OSS functions:
Odd-unstructured Format 1 files (file types 0, 100, and 180). These files permit reading and
writing of both even and odd byte counts and positioning to both even and odd byte addresses.
Unstructured files do not have a built-in record structure.
On G06.29 and later G-series RVUs, H06.06 and later H-series RVUs, and J-series RVUs,
using certain OSS APIs, odd-unstructured files (file types 0, 100, and 180). These files permit
File Interoperability 77