HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
r
recv(2) recv(2)
getsockopt(2).)
[EBADF] The argument s is an invalid descriptor.
[ECONNRESET] A connection was forcibly closed by a peer.
[EFAULT] An invalid pointer was specified in the buf , from , or fromlen parameter, or in
the msghdr structure.
[EINTR] The receive was interrupted by delivery of a signal before any data was available
for the receive.
[EINVAL] The len parameter or a length in the msghdr structure is invalid; or no data is
availableon receive of out of band data.
[EMFILE] The number of file descriptors available to the calling process has been exceeded.
[EMSGSIZE] A length in the msghdr structure is invalid.
[ENOBUFS] Insufficient resources were availablein the system to perform the operation.
[ENOSR] Buffers could not be allocated for the message that was to be created due to
insufficient STREAMS memory resources.
[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.
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)).
MULTITHREAD USAGE
The
recv(), recvmsg(), and recvfrom() system calls are thread-safe. They each have a cancella-
tion point; and they are async-cancel safe, async-signal safe, and fork-safe.
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), af_ccitt(7F), af_vme_link(7F), inet(7F), socket(7), sock-
etx25(7), tcp(7P), udp(7P), unix(7P), xopen_networking(7).
Section 2−−258 − 5 − HP-UX Release 11i: December 2000
___
___