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

OSS sockets support capture of the SIGURG signal. BSD sockets support capture of the SIGURG
and SIGIO signals.
In the OSS environment, the SIGURG signal is enabled by using the fcntl() function to
invoke the F_SETOWN command. In a BSD environment, SIGURG is enabled using the fcntl()
function to invoke the FASYNC command.
The OSS API does not provide the poll() function:
The OSS API provides the select() function and the Guardian API provides the
FILE_COMPLETE_ procedure; either can be used in place of the poll() function.
The OSS API does not currently support raw sockets.
Porting Situations
You need to consider four different porting situations when porting UNIX programs that use BSD
sockets to the OSS environment:
Blocking socket I/O
Programs using blocking socket input/output can generally be ported to the OSS environment
with minimal changes, provided the “General Considerations” (page 178) are observed.
Blocking socket I/O with fork() and exec set of functions
Programs using blocking socket input/output with fork() and the exec set of functions
should be portable with no changes. However, you might wish to consider the performance
impact of using dynamic servers, static servers, or persistent processes when porting. Static
and persistent servers and other performance considerations when processing requests are
discussed in “Porting Servers and Demons” (page 103).
Nonblocking socket I/O
A BSD sockets application using nonblocking socket input/output can be easily ported to the
OSS environment with one minor change. In the UNIX environment, a socket is marked as
nonblocking by calling the fcntl() function for the socket descriptor and using the function’s
F_SETFL command to set the FNDELAY flag. The OSS environment does not support the
FNDELAY flag; instead, an OSS application calls fcntl() and sets the O_NONBLOCK flag
to mark a socket as nonblocking.
inetd activated services
Applications using inetd activated services can generally be ported to the OSS environment
with minimal changes, provided the “General Considerations” (page 178) are observed. For
more information, refer to “Starting an OSS Server Process” (page 106).
Porting Guardian Sockets Applications to the OSS Environment
The following subsections discuss:
“General Considerations” (page 181)
“Differences Between OSS Sockets and Guardian Sockets” (page 181)
“Compiling Native and TNS OSS Programs” (page 183)
Additional considerations and sample programs can be found in the Open System Services
Programmer’s Guide.
180 Porting or Migrating Sockets Applications