From: "Iñaki Baz Castillo" Date: 2010-01-16T02:52:05+09:00 Subject: Re: How to know the OS architecture (32 or 64 bits)? El Viernes, 15 de Enero de 2010, Seebs escribió: > > 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. Yes, for now I use 1.size to determine if I'm under 32 or 64 bits but it's just a hack. Most probably I will code a small C extension method with returns the exact value of sizeof(struct msg_msg *). Then the calculated valued would be exact for any kinf of strange architecture (I hope). Regards. -- Iñaki Baz Castillo