HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)
r
recv(2) recv(2)
[ENOTCONN] Receive on a SOCK_STREAM socket that is not yet connected.
[ENOTSOCK] The argument s is a valid file descriptor, but it is not a socket.
[EOPNOTSUPP] The
MSG_OOB flag was set for a UDP SOCK_DGRAM message-based socket, or
MSG_OOB or MSG_PEEK was set for any AF_UNIX socket. The
MSG_OOB flag
is supported only for stream-based TCP SOCK_STREAM sockets. Neither
MSG_PEEK nor MSG_OOB is supported for AF_UNIX sockets.
AF_CCITT only: recv() was issued on a
listen() socket.
[ETIMEDOUT] The connection timed out during connection establishment, or due to a transmis-
sion timeout on active connection.
[EWOULDBLOCK] Non-blocking I/O is enabled using
ioctl() FIOSNBIO request, and the
requested operation would block.
WARNINGS
IPv6 is supported on HP-UX 11i Version 1.0, with the optional IPv6 software installed. Currently, IPv6 is
not supported on systems running HP-UX 11i Version 1.6.
OBSOLESCENCE
Currently, the
socklen_t and size_t types are the same size. This is compatible with both the UNIX
95 and UNIX 98 profiles. However, in a future release, socklen_t might be a different size. In that
case, passing a size_t pointer will evoke compile-time warnings, which must be corrected in order for the
application to behave correctly. Also, the size of the msghdr and cmsghdr structures and the relative
position of their members will be different, which might affect application behavior. Applications that use
socklen_t now, where appropriate, will avoid such migration problems. On the other hand, applications
that need to be portable to the UNIX 95 profile should follow the X/Open specification (see
xopen_networking(7)).
FUTURE DIRECTION
Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open
Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with
X/Open Sockets might be obsoleted. Applications that conform to the X/Open specification now will avoid
migration problems (see xopen_networking(7)).
AUTHOR
recv(), recvmsg(), and recvfrom() were developed by HP and the University of California, Berke-
ley.
SEE ALSO
getsockopt(2), read(2), select(2), send(2), socket(2), thread_safety(5), inet(7F), ip6(7P), sctp(7P), socket(7),
tcp(7P), udp(7P), unix(7P), xopen_networking(7).
STANDARDS CONFORMANCE
recv(): XPG4
HP-UX 11i Version 2: December 2007 Update − 6 − Hewlett-Packard Company 323