Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

POSIX shared memory question



Hello.  I have a question for using POSIX shared memory.  There is a possibility that my process could crash before it would have called shm_unlink.  I have two basic questions:

a) What is the best method to deal with cleanup?  I guess catching as many relevant signals as possible and cleaning up might help (SIGSEGV, SIGBUS, SIGABRT come to mind, though I'm not sure I could catch them), but is there a better approach, or complementary operations?  There are at least two signals which I cannot catch.  According to the manpage of shm_open, shared memory references do not survive a reboot, but I'd like to keep the filesystem as clean as possible.
b) After I create the shared memory object via shm_open, call ftruncate, and map it via mmap, should I not see the object in the filesystem (well, after shm_open at least)?  So far I cannot find it through the shell, yet no error is returned in my code.  Is it created in a different namespace?  How can I view all created shared memory objects in the system?

thanks for any help,

Philip Lukidis 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.