Re: POSIX shm_unlink() problem
Re: POSIX shm_unlink() problem
- Subject: Re: POSIX shm_unlink() problem
- From: Paul Ripke <email@hidden>
- Date: Fri, 5 Nov 2004 23:21:27 +1100
On Friday, Nov 5, 2004, at 10:15 Australia/Sydney, Peter Lovell wrote:
On Nov 4, 2004, at 5:26 PM, Jeff W. Boote wrote:
I am having problems using shm_unlink() on Panther. Is anyone using
this system call successfully on OS X?
After failure, errno is set to EINVAL (which is not even one of the
documented possible errors).
I'm attaching a fairly simple test case that works on FreeBSD and
Linux.
Thanks,
jeff
My recollection is that the name must not have any slashes (i.e. it's
a name and not a path). I think also that there's a 31-character > limit.
Not quite. From
<http://www.opengroup.org/onlinepubs/009695399/functions/shm_open.html>:
The name argument points to a string naming a shared memory
object. It is unspecified whether the name appears in the
file system and is visible to other functions that take
pathnames as arguments. The name argument conforms to the
construction rules for a pathname. If name begins with the
slash character, then processes calling shm_open() with the
same value of name refer to the same shared memory object,
as long as that name has not been removed. If name does not
begin with the slash character, the effect is implementation-
defined. The interpretation of slash characters other than
the leading slash character in name is implementation-defined.
Checking posix_shm.c in xnu, max name length is indeed 31, and there
is a conditional piece of code that can enforce the leading slash.
Not sure if this is enabled by default or not.
It seems that every system has differing rules for name (sigh).
Maybe so, but hopefully they fit within the bounds of the
standards :)
cheers,
--
stix
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden