Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/recv.2
| Show All 22 Lines | |||||
| .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
| .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
| .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
| .\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
| .\" | .\" | ||||
| .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 | .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 | ||||
| .\" $FreeBSD$ | .\" $FreeBSD$ | ||||
| .\" | .\" | ||||
| .Dd October 3, 2017 | .Dd May 20, 2018 | ||||
| .Dt RECV 2 | .Dt RECV 2 | ||||
| .Os | .Os | ||||
| .Sh NAME | .Sh NAME | ||||
| .Nm recv , | .Nm recv , | ||||
| .Nm recvfrom , | .Nm recvfrom , | ||||
| .Nm recvmsg , | .Nm recvmsg , | ||||
| .Nm recvmmsg | .Nm recvmmsg | ||||
| .Nd receive message(s) from a socket | .Nd receive message(s) from a socket | ||||
| ▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
| or the next data to be received is of a different type than that returned. | or the next data to be received is of a different type than that returned. | ||||
| The | The | ||||
| .Dv MSG_DONTWAIT | .Dv MSG_DONTWAIT | ||||
| flag requests the call to return when it would block otherwise. | flag requests the call to return when it would block otherwise. | ||||
| If no data is available, | If no data is available, | ||||
| .Va errno | .Va errno | ||||
| is set to | is set to | ||||
| .Er EAGAIN . | .Er EAGAIN . | ||||
| This flag is not available in strict | This flag is not available in strict ANSI or C99 compilation mode. | ||||
| .Tn ANSI | |||||
| or C99 compilation mode. | |||||
| The | The | ||||
| .Dv MSG_WAITFORONE | .Dv MSG_WAITFORONE | ||||
| flag sets MSG_DONTWAIT after the first message has been received. | flag sets MSG_DONTWAIT after the first message has been received. | ||||
| This flag is only relevant for | This flag is only relevant for | ||||
| .Fn recvmmsg . | .Fn recvmmsg . | ||||
| .Pp | .Pp | ||||
| The | The | ||||
| .Fn recvmsg | .Fn recvmsg | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
| is returned to indicate that expedited or out-of-band data were received. | is returned to indicate that expedited or out-of-band data were received. | ||||
| .Pp | .Pp | ||||
| The | The | ||||
| .Fn recvmmsg | .Fn recvmmsg | ||||
| system call uses the | system call uses the | ||||
| .Fa mmsghdr | .Fa mmsghdr | ||||
| structure, defined as follows in the | structure, defined as follows in the | ||||
| .In sys/socket.h | .In sys/socket.h | ||||
| header : | header: | ||||
| .Bd -literal | .Bd -literal | ||||
| struct mmsghdr { | struct mmsghdr { | ||||
| struct msghdr msg_hdr; /* message header */ | struct msghdr msg_hdr; /* message header */ | ||||
| ssize_t msg_len; /* message length */ | ssize_t msg_len; /* message length */ | ||||
| }; | }; | ||||
| .Ed | .Ed | ||||
| .Pp | .Pp | ||||
| On data reception the | On data reception the | ||||
| ▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines | |||||