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-21
Using OSS Function Calls
Using the lstat(), readlink(), and symlink() Functions
You cannot use the lstat(), readlink(), or symlink() functions to set symbolic
links in the Guardian file system. However, Guardian files can be pointed to by
symbolic links created in the OSS file system.
Using the mkdir() Function
You are allowed to use the mkdir() function call in the OSS file system as long as
you do not set any bits in the mode parameter other than the file permission bits,
S_ISVTX, and S_IFDIR. The group ID is set to the group ID of the parent directory if
the S_ISGID parameter is set in the parent directory; otherwise, the group ID is set to
the effective group ID of the calling process. mkdir() cannot be used to create a
directory named /dev, /dev/null, /dev/tty, or /lost+found in the root directory
of an OSS fileset.
When you use mkdir() for directories within the Guardian file system, the owner ID is
set to 65535 (the group ID is set to 255), and the permission bits are set to
rwxrwxrwx.” Only Guardian subvolumes can be created within the Guardian file
system; mkdir() cannot create a Guardian node, volume, or file.
Using the mknod() Function
The mknod() function can be used to create a new OSS file that is a FIFO, character-
special, directory, or regular file. If the file type is S_IFCHR (character-special), the
following values are defined for the device parameter:
00000003xxxxxxxx, infinite data source and data sink, such as /dev/null,
where the device number specified by xxxxxxxx is unique within the program.
00000002xxxxxxxx, a synonym for a controlling terminal, such as /dev/tty,
where the device number specified by xxxxxxxx is unique within the program.
In the Guardian file system (/G), only regular files (within subvolume directories) and
directories at the subvolume level can be created. The file protection parameters
S_ISUID, S_ISGID, and S_ISVTX are ignored, as they are for all files created in /G.
Using the mkfifo() Function
You cannot use the mkfifo() function to create FIFOs in the Guardian file system.
Using the open() Function
The open() function call can be used to open and create files in the Guardian file
system. Only odd-unstructured, EDIT, or tty-simulation process files can be opened.
Attempts to open other Guardian files fail. Regular Guardian files are opened in
shared-exclusion mode; EDIT files are opened in protected-exclusion mode.
Files created in the Guardian file system are created as odd-unstructured, with a file
code of 180 and access permissions of “rwxr-xr-x.” During open() or creat()
function processing, all access permissions are checked. Checks are performed by