Does FreeBSD have sendmmsg or recvmmsg system calls?

Konstantin Belousov kostikbel at gmail.com
Mon Jan 4 19:40:51 UTC 2016


On Mon, Jan 04, 2016 at 10:17:47AM +0000, Mark Delany wrote:
> > Why is a signal lost in the scenario you described ?
> 
> Because the return can only indicate a signal/error *or* a batch of
> messages but not both and the semantics of recvmsg() means that both
> could occur.
> 
> Don't just consider signals, consider any -1/errno return from
> recvmsg() such as -1/EAGAIN or -1/ENOBUFS or -1/EFAULT.
> 
> If one emulates recvmmsg() via multiple calls to recvmsg() and the
> emulation receives 'n' messages via recvmsg() then gets a -1/EFAULT
> return on message 'n'+1 then what does it return to the caller?
> 
> If it returns 'n' messages then the EFAULT is lost.
> 
> If it returns -1/EFAULT then the 'n' messages are lost.

You just repeat arguments for the text in my messages, which you removed
on reply.

Of course, it is unacceptable to loose the received data.  Of course,
the EFAULT or other similar error would be encountered on the next call.
If it is not encountered because user passed other buffer, it is even
better.  If the issue is with the socket state itself, then the error
will be reported on next call, as it is done for all other socket
functions.

This is how the system works already.


More information about the freebsd-net mailing list