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

OSS programs are CRE-compliant. You can call explicitly many CRE library functions from both
OSS and Guardian modules. Services provided for the OSS environment include:
Process initialization and termination routines
Management of user and run-time heaps
Math and string functions
Access to standard functions
Direct interface to Guardian procedures
Further information on CRE library functions can be found in Chapter 8 (page 136) and in the
Common Run-Time Environment (CRE) Programmer’s Guide.
Using OSS Function Calls
The OSS function calls specified by the POSIX.1 and POSIX.2 standards are compliant with those
standards. However, the POSIX standards do allow for implementation-defined behavior, which
is described in this subsection. UNIX application programs ported to the OSS environment might
be affected by this behavior. Because many of the OSS file system and process-control function
calls can also manipulate Guardian objects, access to Guardian objects can affect the behavior
of the function call. Some error codes can be returned by these function calls that would not be
returned in a UNIX environment. These errors are documented in the online reference pages for
the OSS function calls.
Using OSS File Function Calls
Most file-related function calls that implement the POSIX standards or the XPG4 specifications have
no side effects or implementation-defined behavior when used with OSS files. Some of these function
calls on Guardian files behave differently from the same operations on OSS files.
The Guardian files that can be operated on are limited to odd-unstructured, EDIT, and terminal
emulation processes. Access to files is determined by the security model of the object. Guardian
files are protected by the Guardian security model; OSS files are protected by the POSIX.1 security
model. The file-related function calls that exhibit implementation-defined behavior or which behave
differently when manipulating Guardian files are discussed following.
Special Considerations for Files in Restricted-Access Filesets
Applications that depend on the super ID (255,255 in the Guardian environment, 65535 in the
OSS environment) for file access are subject to additional restrictions for files that are in
restricted-access filesets. When accessing a file in a restricted-access fileset, the super ID is restricted
by the same file permissions and owner privileges as any other user ID: It has no special privileges
unless the executable file started by the super ID has the PRIVSETID file privilege. In this case, the
process started by the super ID can switch to another ID and then access files in restricted-access
filesets as that ID. Therefore the super ID is denied special access privileges when using file functions
such as these:
access()
acl()
bind()
chdir()
chmod(), lchmod(), and fchmod()
chown(), lchown(), and fchown()
creat(), and creat64()
link()
mkfifo()
mknod()
open(), and open64()
122 Porting UNIX Applications to the OSS Environment