| www.delorie.com/gnu/docs/glibc/libc_337.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The recv function is declared in the header file
`sys/socket.h'. If your flags argument is zero, you can
just as well use read instead of recv; see 13.2 Input and Output Primitives.
recv function is like read, but with the additional
flags flags. The possible values of flags are described
in 16.9.5.3 Socket Data Options.
If nonblocking mode is set for socket, and no data are available to
be read, recv fails immediately rather than waiting. See section 13.14 File Status Flags, for information about nonblocking mode.
This function returns the number of bytes received, or -1 on failure.
The following errno error conditions are defined for this function:
EBADF
ENOTSOCK
EWOULDBLOCK
recv blocks until there is input
available to be read.)
EINTR
ENOTCONN
This function is defined as a cancellation point in multi-threaded programs, so one has to be prepared for this and make sure that allocated resources (like memory, files descriptors, semaphores or whatever) are freed even if the thread is canceled.
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |