From owner-freebsd-current Sat Dec 14 20:27:51 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4ECE37B401 for ; Sat, 14 Dec 2002 20:27:49 -0800 (PST) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E05243EC2 for ; Sat, 14 Dec 2002 20:27:44 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from [216.20.231.174] (helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18NQNO-0001hN-00; Sat, 14 Dec 2002 20:27:38 -0800 Message-ID: <3DFC0464.A72308AC@mindspring.com> Date: Sat, 14 Dec 2002 20:26:12 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Joe Kelsey Cc: freebsd-current@freebsd.org Subject: Re: Posix Semaphores in -CURRENT References: <3DF8F08E.8050809@mail.flyingcroc.net> <3DFA0771.BDFC87A8@mindspring.com> <3DFA0DAC.2070801@mail.flyingcroc.net> <3DFA1251.C4755C5B@mindspring.com> <3DFA18CC.8090205@mail.flyingcroc.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4d97230bffc7c3b590fb7e3df2882df98350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joe Kelsey wrote: > /* name must start with a '/' but not contain one. */ > if (*name != '/' || len < 2 || index(name + 1, '/') != NULL) { > free(ret, M_SEM); > return (EINVAL); > } > > The comment makes it look like this code allows a 14-character named > semaphore which *must* start with a slash and cannot contain embedded > slashes. In other words, it does *not* conform to pathname semantics. OK, this is a bug. The semantics don't conform to POSIX. It looks like FreeBSD's version doesn't use filesystem objects, and makes up its own namespace (a flat one) in which to create the semaphores. Even if it's not an FS thing, the POSIX semantics pretty much guarantee at *least* the ability to create your own named namespace, one deep, with the '/' as a namespace component seperator, even if it's not a path component seperator. I rather imagine the correct thing to do is to root it in the FS, and, without a leading '/', treat it as relative to the process current directory. Basically, this is not a two line fix... it's a lot of work, to get a filesystem object to use. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message