Contents

sock_receivembuf

Declaration

errno_t sock_receivembuf(socket_t so, struct msghdr *msg, mbuf_t *data, int flags, size_t *recvlen);

Parameters

  • so:

    The socket.

  • msg:

    The msg describing how the data should be received. May be NULL. The msg_iov is ignored.

  • data:

    Upon return *data will be a reference to an mbuf chain containing the data received. This eliminates copying the data out of the mbufs. Caller is responsible for freeing the mbufs.

  • flags:

    See 'man 2 recvmsg'.

  • recvlen:

    Maximum number of bytes to receive in the mbuf chain. Upon return, this value will be set to the number of bytes received, same as return value of userland recvmsg.

Return Value

0 on success, EWOULDBLOCK if non-blocking and operation would cause the thread to block, otherwise the errno error.

Discussion

Receive data from a socket. Similar to sock_receive though data is returned as a chain of mbufs. See 'man 2 recvmsg' for more information about receiving data.

See Also

Network Kernel Extensions