Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
recvmsg(2) OSS System Calls Reference Manual
For AF_UNIX Release 1 sockets and for AF_UNIX Release 2 sockets in compatibility mode,
when the file to which a sending datagram socket is bound is unlinked or renamed, and one of the
send set of functions is called, the receiving client’s call to recvmsg() returns a null address (all
fields in the address are zero).
For AF_UNIX Release 2 sockets in portability mode, when the file to which a sending datagram
socket is bound is unlinked or renamed, and one of the send set of functions is called, the receiv-
ing client’s call to recvmsg() returns the fully-qualified form of the address to which the sending
socket was originally bound.
For more information about AF_UNIX Release 2 sockets, portability mode, and compatibility
mode, see the Open System Services Programmer’s Guide.
For J06.07 and later J-series RVUs and H06.18 and later H-series RVUs, if a memory resource
allocation error occurs while attempting this operation, the operation succeeds but the resulting
file descriptor is not usable. All subsequent file operations that attempt to use the file descriptor
fail with the error [EBADF].
To use the recvmsg() functionality in a threaded application that uses the Standard POSIX
Threads library, see spt_recvmsgx(2).
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the fol-
lowing tasks to make the function thread-aware in a multi-threaded application:
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
To use this function in a 32-bit threaded application that uses the POSIX User Thread Model
library on systems running H06.24 or later RVUs or J06.13 or later RVUs, perform the same
tasks (described above) used to enable the function on systems running H06.21/J06.10 or later
RVUs.
To use this function in a 64-bit threaded application that uses the POSIX User Thread Model
library on systems running H06.24 or later RVUs or J06.13 or later RVUs, you must perform all
of the following tasks:
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Compile the application using the -Wlp64 compiler command option.
• Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys-
tem Services environment, see the Open System Services Programmer’s Guide.
RETURN VALUES
Upon successful completion, the recvmsg() function returns the length of the received message
in bytes. If no data is available and the peer socket has performed an orderly shutdown, 0 (zero)
is returned.
If the recvmsg() function call fails, the value -1 is returned, and errno is set to indicate the error.
6−36 Hewlett-Packard Company 527186-023