Open System Services Programmer's Guide

Sockets are created in compatibility mode by default. The mode of the socket is determined
by the name of the transport provider process when the socket is created. After a socket
is created, the mode of the socket cannot be changed.
Sockets created in compatibility mode can communicate with other sockets created in
compatibility mode but cannot communicate with sockets created in portability mode.
Sockets created in portability mode can communicate with other sockets created in
portability mode but cannot communicate with sockets created in compatibility mode.
The accept() function creates a socket in the same mode as the listening socket whose
file descriptor is passed.
Compatibility Mode
Sockets created in compatibility mode have these characteristics and behaviors, which are the
same as the characteristics and behaviors for AF_UNIX Release 1 sockets:
If a relative name is passed to connect() then subsequent getpeername() calls return
that same relative name. That is, whatever pathname is passed to connect() is returned,
byte-for-byte, in subsequent calls to getpeername(), including path names beginning with
/E/local_system/ and names containing /./ or /../.
If the file to which a socket is bound is removed or renamed, calls to getsockname() fail
with the error FE_ENOENT.
If the file to which a datagram socket is bound is removed or renamed, and then a send
operation is performed on the socket, a recvfrom() or recvmsg() call on the receiving
socket returns a null address.
A call to listen() with a backlog parameter less than or equal to 0 (zero) causes
subsequent connect() calls to fail with the ECONNREFUSED error unless the socket has a
pending accept() call.
You can create sockets in compatibility mode using one of these methods:
Use the default transport-provider name. For systems running AF_UNIX Release 2 software,
the default AF_UNIX transport-provider name is $ZPLS, which results in sockets created in
compatibility mode.
Use the Guardian DEFINE =_AFUNIX_PROCESS_NAME to specify $ZPLS as the transport
provider name. This Guardian define must be a MAP DEFINE with a FILE attribute string of
the desired AF_UNIX transport-provider name. For example:
TACL> ADD DEFINE =_AFUNIX_PROCESS_NAME,CLASS MAP,FILE $ZPLS
or
OSH> add_define =_AFUNIX_PROCESS_NAME class=MAP file=\$ZPLS
NOTE: Although the name $ZPLS is used as a transport-provider name, $ZPLS is not a
process that runs on the system.
Use the socket_transport_name_set() function to specify $ZPLS as the transport provider
name. This method overrides the default transport-provider name and allows you to create
sockets in either mode within the same application.
Portability Mode
Sockets created in portability mode have these characteristics and behaviors:
If a relative name is passed to connect() then subsequent getpeername() calls return
the corresponding absolute name. That is, the absolute path name returned by
188 Interprocess Communication