Open System Services System Calls Reference Manual (G06.25+, H06.03+)
socket(2) OSS System Calls Reference Manual
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.
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.
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.
The default AF_UNIX transport-provider name is $ZPLS, the only supported AF_UNIX
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_UNIX transport-provider name is not supported. 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.
Preventing Memory Conflicts
OSS socket applications use QIO shared memory to exchange data with the OSS transport agent.
QIO uses some areas of memory for internal message processing, and it is necessary to prevent
OSS socket applications from using overlapping memory ranges. Do either of these things to
prevent memory conflicts between your socket application and QIO:
• If possible, do not specify a flat segment address; instead allow the operating system to
allocate a starting region for you by specifying a null pointer as the second parameter in
the call to the shmat() function, as shown:
char *base_Ptr = shmat(shmid, (void*) 0, shmflag);
7−72 Hewlett-Packard Company 527186-003