sashoalm
sashoalm

Reputation: 79467

Why does msgrcv() return error with errno=7 (E2BIG)?

I've built a small example that uses msgsnd and msgrcv, but sometimes msgrcv() returns E2BIG, and I'm not sure why that is, since I pass is the same msgsz to both msgsnd() and msgrcv().

Upvotes: 1

Views: 1373

Answers (1)

sashoalm
sashoalm

Reputation: 79467

I hand't realized that a named queue is persistent between runs, and msgrcv() was trying to read messages from the queue posted by previous runs of my application, which had been compiled with a larger msgsz at the time.

Upvotes: 2

Related Questions