« Return to Thread: seeking advice on my POSIX wrapper

Re: seeking advice on my POSIX wrapper

by Brandon S. Allbery KF8NH :: Rate this Message:

Reply to Author | View in Thread


On 2008 May 10, at 16:47, Galchin, Vasili wrote:

     Last night I sent out an announcement about some POSIX work that I have been doing. In any case, one of the FFI wrappers is driving me crazy, i.e. the one for mq_receive:http://opengroup.org/onlinepubs/007908799/xsh/mq_receive.html  . When I call this function (mqReceive), I get "message too long". In my test cases I am sending and receiving messages that are only 11 bytes! The wrapper seems really straightforward. Perhaps  I am looking right at the problem and don't see. I need other eyes on the wrapper to help me ;^). Please see below.

What's the other end sending?

I suspect most implementations of mq_receive() layer it on top of msgrcv(), which can return E2BIG (== EMSGSIZE) if the message to be received is larger than the receiving buffer --- a condition which I note mq_receive() does not document (unless mq_msgsize means a given queue only supports fixed size messages, which seems odd).

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@...
system administrator [openafs,heimdal,too many hats] allbery@...
electrical and computer engineering, carnegie mellon university    KF8NH



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

 « Return to Thread: seeking advice on my POSIX wrapper

LightInTheBox - Buy quality products at wholesale price