public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* POSIX message queues, libmqueue: mq_open, mq_unlink
@ 2004-04-16  8:11 Alex Riesen
  2004-04-16 16:13 ` Ulrich Drepper
  0 siblings, 1 reply; 10+ messages in thread
From: Alex Riesen @ 2004-04-16  8:11 UTC (permalink / raw)
  To: Michal Wronski; +Cc: Krzysztof Benedyczak, linux-kernel

Hi,

I just noticed that mqs were included in the 2.6.6-rc1.

Looking over the code in libmqueue-4.31, I noticed the checks for the
name validity in the mq_open and mq_unlink. Why are they needed?  They
are pointless if the code in kernel depends on the valid name, because
libmqueue can not be the only library using the mq interface (all the
libcs being the next candidates), and they are pointless in case the
kernel does not depend on them, because it will return an error anyway,
if that is defined by the implementation.
Can the checks be removed? Cutting of the first character will become
unconditional than, btw, which is also not good.

The other thing: mq_open gets the last two args (attr and mode)
unconditionally. What will the kernel code get in the arguments if
O_CREAT is not specified, and the calling code did not given the
arguments?
I don't think this will ever cause any problem, but the code is unclean
in this aspect.

Sincerely,
Alex Riesen

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: POSIX message queues, libmqueue: mq_open, mq_unlink
@ 2004-04-17 10:49 Manfred Spraul
  2004-04-17 11:16 ` Alex Riesen
  0 siblings, 1 reply; 10+ messages in thread
From: Manfred Spraul @ 2004-04-17 10:49 UTC (permalink / raw)
  To: Alex Riesen; +Cc: linux-kernel

Alex wrote:

>Ok. It's just that every provider of the _kernel_ interface to user
>space has now to take care of being posix-compliant. Write the code for
>checks, iow. That is not the case for "open", for instance.
>And besides, with the patch applied the kernel is also posix compliant,
>isn't it?
>
No. E.g. mq_notify(,&{.sigev_notify=SIGEV_THREAD) cannot be implemented 
in kernel space. And sys_mq_getsetattr isn't posix compliant either - 
the user space library must implement mq_getattr and mq_setattr on top 
of the kernel API.
The kernel API was designed to be simple and flexible. Perhaps we want 
to extend the kernel implementation in the future, and then a leading 
slash could be used to indicate that we are using the new features.

--
    Manfred


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-04-17 11:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-16  8:11 POSIX message queues, libmqueue: mq_open, mq_unlink Alex Riesen
2004-04-16 16:13 ` Ulrich Drepper
2004-04-16 21:38   ` Alex Riesen
2004-04-16 22:17     ` Ulrich Drepper
2004-04-16 22:22     ` Chris Wright
2004-04-16 23:43       ` Alex Riesen
2004-04-16 23:56         ` Chris Wright
2004-04-17  8:20           ` Alex Riesen
  -- strict thread matches above, loose matches on Subject: below --
2004-04-17 10:49 Manfred Spraul
2004-04-17 11:16 ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox