Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Porting UNIX Applications to the OSS Environment
Open System Services Porting Guide520573-006
7-23
Using OSS Function Calls
Using the stat() and fstat() Functions
For files other than regular OSS files, the stat() and fstat() functions return zero
as the value for the st_size field of the stat structure and 4096 as the value for
directories. For regular OSS files, the size of the file is returned.
For Guardian EDIT files, the st_size field specifies the actual (physical) end of a file,
not the number of bytes in the file. For Guardian files, the st_dev and st_ino fields
of the stat structure do not uniquely identify Guardian files. The st_dev field is
unique for /G, for each disk volume, and for each Telserv process. The st_ctime and
st_atime fields for Guardian regular files are updated by OSS function calls, not by
Guardian procedure calls. There is a mapping for each Guardian file type to one of
directory, regular file, or character special file type in the st_mode field. These
mappings are listed in the stat(2) reference page either online or in the Open
System Services System Calls Reference Manual.
Using the unlink() Function
The unlink() function is not supported for Guardian directories, structured files, and
OSS directories.
OSS Process Function Calls
Most process-related function calls that implement the POSIX.1 standard or XPG4
specifications have no side effects or implementation-defined behavior when operating
on OSS processes. However, some function calls can also manipulate Guardian
processes. Some operations on Guardian processes behave differently from the same
operations on OSS processes.
Operations on Guardian processes with OSS function calls are limited because
Guardian processes do not have process IDs. Access to processes is determined by
the security model of the object; Guardian processes are protected by the Guardian
security model, and OSS processes are protected by the POSIX.1 security model. The
process-related function calls that exhibit implementation-defined behavior or that
behave differently when manipulating Guardian processes are discussed here.
Using the fork() and exec Set of Functions
The standard POSIX.1 fork() function and exec set of functions are implemented in
the OSS environment. In addition to the normal POSIX.1 inheritance rules, the child
process also inherits a number of Guardian attributes from the parent process.
Table 7-2 illustrates some of the key differences in process attributes after the
execution of the fork() function or the exec set of functions in the OSS environment.