Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for June 20, 2013
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Ghosts of Unix Past: a historic search for design patterns
Posted Oct 27, 2010 21:22 UTC (Wed) by HelloWorld (guest, #56129)
Posted Oct 28, 2010 10:02 UTC (Thu) by Yorick (subscriber, #19241)
Again and again, the same design mistakes, probably with excellent excuses every time.
Posted Nov 1, 2010 8:21 UTC (Mon) by kleptog (subscriber, #1183)
This comes up every now and then when people want PostgreSQL to use POSIX shared memory or mmap(). Turns out that there is no portable replacement for all the features of SysV shared memory. Which means you could do it, but you lose a number of safety-interlocks you have now. And safety of data is critical to databases.
Posted Nov 7, 2010 0:25 UTC (Sun) by kevinm (guest, #69913)
(If you don't care about that, you can just walk /proc/*/fd/* to count the number of opens, with either POSIX shm or mmap).
Posted Nov 7, 2010 16:09 UTC (Sun) by kleptog (subscriber, #1183)
Given that is this situation attachments are created by fork() only (other than the initial one) if you have nattach == 1, you know there won't be another attachment other than by starting a complete new process. (The 1 is ofcourse yourself).
As for /proc/*/fd/*, that's hardly portable and more importantly, you're not required to have a file descriptor for a shared memory segment which means you need /proc/*/maps which is even less portable. Besides the fact that processes owned by other users are not examinable.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds