Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S270827AbTGNU2z (ORCPT ); Mon, 14 Jul 2003 16:28:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S270829AbTGNU1v (ORCPT ); Mon, 14 Jul 2003 16:27:51 -0400 Received: from pc2-cwma1-4-cust86.swan.cable.ntl.com ([213.105.254.86]:11716 "EHLO lxorguk.ukuu.org.uk") by vger.kernel.org with ESMTP id S270827AbTGNU1P (ORCPT ); Mon, 14 Jul 2003 16:27:15 -0400 Subject: Re: [RFC][PATCH] Posix Message Queues From: Alan Cox To: Manfred Spraul Cc: Michal Wronski , Linux Kernel Mailing List , Christoph Hellwig In-Reply-To: <3F130F94.2030903@colorfullife.com> References: <3F130F94.2030903@colorfullife.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Message-Id: <1058215159.606.157.camel@dhcp22.swansea.linux.org.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 14 Jul 2003 21:39:19 +0100 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 783 Lines: 23 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/