0

What is the expected behaviour of recvmsg/sendmsg when flags=0?

I came across an example in some vsomeip 3.3 code (here for example) that I'm debugging (ported to QNX) and I'm unsure how to interpret this. I even see some SO questions that use 0 for flags.

The docs for recvmsg say:

The flags argument to a recv() call is formed by ORing one or more of the following values:

(I'm on QNX, and they specify the same)

I'm confused because the flags can provide opposite behaviour, i.e. MSG_DONTWAIT vs MSG_WAITALL, so I don't know what to should expect from flags=0. (particularly because both those flags seem to sometimes result in an EAGAIN error code on QNX for me right now.)

sendmsg docs do say "0 or more of the following flags", but I'm still confused about that I should expect there too.

When I read some variants of the Linux implementations, it suggests that with flags=0 many sections are just skipped, but I'd like something more authoritative.

Matt
  • 1,928
  • 24
  • 44

0 Answers0