Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
Table 8 Functions Currently Not in the OSS Environment (continued)
Replacement RecommendationFunction
Use fork().vfork()
Use tcsetattr().vhangup()
Use waitpid().wait3()
Differences Between OSS and UNIX Environments
The OSS functions available to programmers conform to the POSIX.1 and POSIX.2 standards and
to the XPG4 specifications. The OSS functions coexist on NonStop systems with the traditional
Guardian interfaces, which a programmer can also use from an OSS program. Access to these
Guardian interfaces is discussed in “Using HP Extensions” (page 129).
This subsection presents the major differences between the OSS environment and other common
UNIX environments—specifically with the file system, process model, and security model.
File Characteristics
The OSS environment supports two file systems: OSS and Guardian. The OSS file system is a
hierarchical file system consisting of directories and files within directories. OSS files have logical
filenames that follow the same conventions as files on other UNIX systems—pathnames can be up
to 1023 characters, and each pathname component can be no greater than 248 characters. The
conventions for root directories and file attributes for the OSS file system are identical to those on
other UNIX systems. OSS file access is controlled by the same protection bits found on other UNIX
systems.
OSS supports regular disk files and special files, such as directories, pipes, FIFOs, and terminal
character files. All OSS regular files are odd-unstructured files. Special device files such as the
/dev/tty and /dev/null files are supported through the OSS functions and have the same
meaning as on other UNIX systems. Opening /dev/tty results in the opening of the program’s
controlling tty, as it does on other UNIX systems. Special files can also be created with the mknod()
function. For more information on using the mknod() function, refer to the mknod(2) reference
page either online or in the Open System Services System Calls Reference Manual.
Local Guardian files can also be accessed by OSS functions through the /G directory in the OSS
file system. Pathnames in the /G directory have the form:
/G/volume/subvolume/file_identifier
where the $ and periods of the Guardian filename are replaced by slashes (/).
A complete, fully qualified Guardian filename has four components: node name, volume name,
subvolume name, and a file identifier; for example, \MYNODE.$MYVOL.MYSUBVOL.MYFILE.
Guardian filenames containing node names are accessible through the /E directory, where
pathnames have the form:
/E/node_name/G/volume/subvolume/file_identifier
OSS functions read and write odd-unstructured Guardian files and read EDIT files. OSS functions
cannot access structured Guardian files. These files can be accessed in an OSS program only by
using Guardian procedure calls. Access to Guardian files is controlled by the “RWEP” character
string, which defines Read, Write, Execute, and Purge access. More details on the OSS and
Guardian file systems can be found in the Open System Services Programmer’s Guide.
Process Characteristics
OSS processes have the same characteristics as UNIX processes in most UNIX systems. You can
create, control, and terminate OSS processes as you would in other UNIX environments. A set of
process functions specific to HP have been added to provide more flexibility in propagating
attributes during process creation and are discussed in “Using HP Extensions” (page 129).
112 Porting UNIX Applications to the OSS Environment