Re: [RFC][PATCH] Posix Message Queues

Alan Cox (alan@lxorguk.ukuu.org.uk)
14 Jul 2003 21:39:19 +0100


On Llu, 2003-07-14 at 21:16, Manfred Spraul wrote:
> Hi Michal,
>
> You've implemented mq_open() in user space by combining open()+ioctl()
> syscalls. I think it's racy:
>
> What if two processes call
> {
> fd = mq_open("dummy",O_CREAT,0777,{.mq_maxmsg=10000});
> mq_send = mq_send(fd,buf,10000,0);
> }
>
> I think setting the queue options and creating a new queue must be
> atomic, i.e. we need a new syscall.

O_EXCL lets you know if you are the real creator. That means you can
create it 000, fix it up, fchmod it and go

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