Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

socket(2) OSS System Calls Reference Manual
$ZAFN2 This transport-provider name is only valid for systems running AF_UNIX
Release 2 software. If the AF_UNIX transport-provider name is $ZAFN2, the
socket is created as an AF_UNIX Release 2 socket in portability mode. Sockets
created in portability mode can communicate with each other but cannot com-
municate with sockets created in compatibility mode.
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. You can set the
transport-provider name using either the socket_transport_name_set() function or the Guardian
DEFINE =_AFUNIX_PROCESS_NAME. This Guardian define must be a MAP DEFINE with a
FILE attribute string of the desired AF_UNIX transport-provider name.
For more information about AF_UNIX Release 2 sockets, portability mode, and compatibility
mode, see the Open System Services Programmer’s Guide.
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);
If you do assign a base address, do not use any address in the range 0x20000000
through 0x41FFFFFF or any of these flat segment regions:
0x20000000 0x22000000 0x24000000 0x26000000
0x28000000 0x2A000000 0x2C000000 0x2E000000
0x30000000 0x32000000 0x34000000 0x36000000
0x38000000 0x3A000000 0x3C000000 0x3E000000
0x40000000 0x42000000 0x44000000 0x46000000
0x48000000 0x4A000000 0x4C000000 0x4E000000
On some processors, QIO allocates its shared memory region by default starting at 0x20000000,
so a QIO configuration of 544 megabytes uses the flat segment regions listed previously. If you
use a null pointer instead of specifying the base address, the operating system allocates flat seg-
ments for your application starting from the topmost region downward. As a result, OSS socket
applications can safely allocate flat segments in any of the upper regions of memory on that pro-
cessor.
If a memory conflict error still occurs, either you must change the memory allocation for your
application or your system administrator must reconfigure QIO.
For more information on the shmat() function, see the shmat(2) reference page. For more infor-
mation on memory addressing, see the Guardian Programmer’s Guide and the server description
manual appropriate for your system.
RETURN VALUES
Upon successful completion, the socket() function returns the file descriptor for the socket. Oth-
erwise, the value -1 is returned, and errno is set to indicate the error.
7116 Hewlett-Packard Company 527186-023