Date: Sat, 14 Dec 2002 20:26:12 -0800 From: Terry Lambert <tlambert2@mindspring.com> To: Joe Kelsey <joek@mail.flyingcroc.net> Cc: freebsd-current@freebsd.org Subject: Re: Posix Semaphores in -CURRENT Message-ID: <3DFC0464.A72308AC@mindspring.com> References: <3DF8F08E.8050809@mail.flyingcroc.net> <3DFA0771.BDFC87A8@mindspring.com> <3DFA0DAC.2070801@mail.flyingcroc.net> <3DFA1251.C4755C5B@mindspring.com> <3DFA18CC.8090205@mail.flyingcroc.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DFC0464.A72308AC>