Re: Shared Memory and Distributed Objects
Re: Shared Memory and Distributed Objects
- Subject: Re: Shared Memory and Distributed Objects
- From: Dan Bernstein <cocoa-dev%email@hidden>
- Date: Sun, 9 Mar 2003 10:31:44 +0200
Finally solved: mmap() will accept an fd from shm_open(), but one has
to ftruncate() that fd to (at least) the required amount of memory
prior to calling mmap() (this has to be done with normal filesystem fds
as well), which I've neglected to do.
I figured it out by browsing the kernel sources. Neglecting to mention
this possible reason for an EINVAL errno from mmap() is clearly a bug
in the documentation.
-- Dan
On Sunday, February 16, 2003, at 10:00 PM, Kaelin Colclasure wrote:
On Sunday, February 16, 2003, at 03:37 AM, Dan Bernstein wrote:
1. Using a shared memory object, opened with shm_open() and mapped
with mmap().
Problem: no matter what I did, I couldn't get mmap() to accept the fd
shm_open() had returned.
mmap() is not used with System V shared memory objects (AFAIK). The fd
mmap() wants is a normal filesystem file handle.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.