Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) socket(2)
Socket-level options control socket operations. The getsockopt() and setsockopt() functions are
used to get and set these options, which are defined in the sys/socket.h file.
Use From the Guardian Environment
The socket() function is one of a set of functions that have these effects when the first of them is
called from the Guardian environment:
• Two Guardian file system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
• The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
• The use of static memory by the process increases slightly.
These effects occur only when the first of the set of functions is called. The effects are not cumu-
lative.
NOTES
This function requires that the feature-test macro _XOPEN_SOURCE_EXTENDED be specified
when you compile the module.dtpa
Choosing the Transport-Provider Process
Each socket declared by a user process is supported by:
• An OSS transport agent process (one per processor)
• A domain-specific transport-provider process (one or more per node)
Each user process has a current transport-provider name for each domain that is used when creat-
ing a socket in that domain.
AF_INET or AFINET6 Sockets
The default AF_INET or AF_INET6 transport-provider name is $ZTC0, unless overridden by
an existing Guardian DEFINE =TCPIPˆPROCESSˆNAME. If =TCPIPˆPROCESSˆNAME exists,
it must be a MAP DEFINE with a FILE attribute string of the desired AF_INET or AF_INET6
transport-provider name.
Each user process can change its AF_INET or AF_INET6 transport-provider name with the
socket_transport_name_set() function and can retrieve its current AF_INET, AF_INET6, and
AF_UNIX transport-provider names with the socket_transport_name_get() function.
Changing the AF_INET or AF_INET6 transport-provider name is meaningful when a node is
configured with multiple TCP/IP processes as part of the AF_INET or AF_INET6 socket
environment.
AF_UNIX Sockets
If the domain is AF_UNIX, the AF_UNIX transport-provider name determines if the socket is an
AF_UNIX Release 1 socket, an AF_UNIX Release 2 socket in compatibility mode, or an
AF_UNIX Release 2 socket in portability mode:
$ZPLS For systems running AF_UNIX Release 1, $ZPLS is the only supported
AF_UNIX transport-provider name and this name cannot be changed.
For systems running AF_UNIX Release 2 software, if the transport-provider
name is $ZPLS, the socket is created as an AF_UNIX Release 2 socket in com-
patibility mode. Sockets in compatibility mode can communicate with each other
but cannot communicate with sockets created in portability mode. The default
AF_UNIX transport-provider name is $ZPLS,
527186-023 Hewlett-Packard Company 7−115