Re: libc changes for large message queue support on Linux

Ulrich Drepper (drepper@cygnus.com)
11 Dec 1998 18:20:25 -0800


<peeter_joot@VNET.IBM.COM> (peeter joot) writes:

> I have recently posted a patch to remove the small ipc message queue
> limitations from the linux kernel. As part of those changes the
> kernel msqid_ds structure had to be altered. Specifically, the
> msg_cbytes and msg_qbyte parameters were from changed from unsigned
> short to unsigned int's to remove the 64K restriction imposed. This
> changes aren't in the kernel images yet, but are in Alan Cox's
> current patch set (patch-2.1.131-ac5).

I've look ed at the patch now. It is not without problems but they
could be solved using the versioning in glibc 2.1. There is no hope
for glibc 2.0 and libc 5 as far as I can see. Your hack with #ifdefs
in the headers is also not acceptable but I can handle this.

But one thing seems to be wrong. The changes to the kernel which your
patch imply (I haven't seen the actual kernel changes) you use an very
ugly trick to detect whether an old library is running on top of a
large kernel (setting the value to zero).

Why not only define a new opcode for msgctl which requires the new
value in the new position. Speaking in glibc terms with your changes:

if (__kernel_large_msqqueue_support == 0)
return __ipc (IPCOP_msgctl, msqid, cmd, 0, buf);
else
return __ipc (IPCOP_msgctl32, msqid, cmd, 0, buf);

This is a much cleaner way and nothing (e.g., segvs) can happen.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/