On 2010-01-15, I?aki Baz Castillo <ibc / aliax.net> wrote:
> When the app runs it tries to create a posix mqueue with maxmsg=5000 and 
> msgsize=1024. The user running the application could have not permissions to 
> create such posix mqueue due to system limits ("ulimit -q").

Ahh.

> The algorimth to know such amount of required bytes is:

>   queue.attr.mq_maxmsg * sizeof(struct msg_msg *) +
>   queue.attr.mq_maxmsg * queue.attr.mq_msgsize

> In 32 bits sizeof(struct msg_msg *) is 4 bytes while in 64 it's 8 bytes, so 
> the total ammount of bytes changes. This means that "ulimit -q" must be 
> different depending on the system architecture (32/64 bits).

Ahh, yes.  Although to be picky, you're now into one of the areas where, if
you ever end up on stranger hardware, the answer may be ill-defined; it
appears you care specifically about pointer sizes.  There are some systems
where "pointer size" is not the same as "integer size", and so on...  So
you could get some surprises.

I suspect Ruby tries to get a 64-bit fixnum if it can, so you're probably
set.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam / seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!