[Haskell-cafe] seeking advice on my POSIX wrapper

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sat May 10 17:09:01 EDT 2008


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 at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080510/37a7ae15/attachment.htm


More information about the Haskell-Cafe mailing list