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-22
Using OSS Function Calls
standard Guardian security mechanisms and by Safeguard for Guardian disk file and
process access.
Using the opendir() and readdir() Functions
The opendir() function call can be used for OSS and Guardian directories. Using
readdir() on the /G, /G/vol, and /G/vol/subvol directories returns all entries,
even files inaccessible through OSS interfaces, such as Enscribe structured files and
SQL tables and views. The first readdir() call after opendir() or rewinddir()
causes the file system to retrieve a block of directory entries from an OSS name
server.
For both Guardian and OSS directories, if files are added to a directory after a block of
entries is obtained from an OSS name server, it is possible that no entry is returned for
the new files. The same applies for deleted files.
Using the read() and write() Functions
The read() and write() function calls read and write to OSS and Guardian files. In
the OSS environment, the maximum buffer size that can be read using read() or
written using write() is the value of the SSIZE_MAX constant (52 kilobytes).
SSIZE_MAX is defined in the limits.h file.
Using the rename() and rmdir() Functions
The rename() and rmdir() function calls are not allowed on /G, /dev, /dev/tty,
/dev/null, or /lost+found in the root directory of an OSS fileset. The rename()
function cannot be used on directories in the Guardian file system, but it can be used
on Guardian permanent disk files, provided the name arguments specify the same
volume and the caller has Guardian write access to the file. Subvolumes in the
Guardian file system can be removed, but volumes cannot.
Using socket() and Related Functions
Calls to the OSS sockets functions for AF_INET and AF_INET6 connections can use
an alternate transport provider process if such a process has been started. The default
transport provider process for AF_INET sockets is $ZTC0. An alternate transport
provider process can be named by setting the Guardian MAP DEFINE
=TCPIP^PROCESS^NAME for the sockets application before starting the application
or by calling the socket_transport_name_set() function while the application is
running. The current transport provider process name can be determined by calling the
socket_transport_name_get() function. If you want to use Parallel Library
TCP/IP or NonStop TCP/IPv6, use one of these methods to specify a TCPSAM or
TCP6SAM process name for the transport service provider. For information about how
to determine the name of a TCPSAM or TCP6SAM process, refer to the TCP/IP
(Parallel Library) Configuration and Management Manual or the TCP/IPv6
Configuration and Management Manual