Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
General Considerations
The following is a list of general considerations for porting a sockets program from the Guardian
environment to the OSS environment:
• Guardian C programs can use 32-bit or 16-bit integers. OSS C programs use only 32-bit
integers.
Most sockets routine arguments are of type int. If your program used the small memory or
large memory model in the Guardian environment, where the size of the sockets library int
is 16 bits, the program needs to be modified to use 32 bits; int arguments such as
socket_number and length are 32 bits in the OSS environment instead of 16 bits. If you
have declared these arguments as int throughout your program, no changes to them should
be required. If you have used any other C declaration type, such as short for a sockets
routine argument, then your program must be changed accordingly.
For more information on converting programs to use the 32-bit data model, refer to the C/C++
Programmer’s Guide.
• Beginning with the H06.24 and J06.13 RVUs, 64-bit OSS socket functions are provided and
if the application being ported uses Guardian socket procedures, the 64-bit OSS socket
functions might be helpful. For information about 64-bit OSS socket functions, see the 64-Bit
Support in OSS and Guardian chapter in the Open System Services System Programmer's
Guide.
Differences Between OSS Sockets and Guardian Sockets
If you have been using Guardian sockets, you should be aware of the differences between the
Guardian implementation and the OSS implementation.
• Guardian processes cannot receive the SIGWINCH signal. OSS processes support this signal.
• Guardian sockets use Guardian file numbers; therefore, Guardian system procedures such as
AWAITIOX, FILE_CLOSE_, FILE_COMPLETION_, and FILE_GETINFO_ can be used on Guardian
sockets.
OSS sockets use OSS file descriptors; therefore, functions such as fstat() and close()
can be used on OSS sockets.
Guardian system procedures cannot be used on OSS file descriptors.
• Guardian sockets are not inherited by child processes; therefore, a Guardian application
needs to call the accept_nw2() function when passing a client connection from parent to
child.
In an OSS sockets application, file descriptors are inherited by the child process; therefore,
no special function call is needed to pass a connection.
• OSS sockets header files are in the same location as on XPG4-compliant UNIX systems.
Table 12 lists Guardian header filenames and their corresponding names in the OSS
environment.
Table 12 Sockets Header Filenames
OSS Header Filename (in /usr/include)Guardian Header Filename
(in $SYSTEM.ZTCPIP)
<netinet/if.h>IFH
<netinet/in.h>INH
<netinet/in6.h>IN6H
<sys/ioctl.h>IOCTLH
<netinet/mbuf.h>MBUFH
Porting Guardian Sockets Applications to the OSS Environment 181