System V IPC on Mac OS X is a bit funny (by alaric)
Well, at long last, I'm finally getting paid to mess around with the kinds of things I find REALLY interesting - a task which, at the moment, involves setting up shared memory and semaphores between processes for some high-speed shared cache action. Sort of like PostgreSQL does.
Anyway, I've found a few quirks of Mac OS X's System V IPC setup that I thought I'd best share.
ipcs
should be setuid or setgid or something. It grovels in kernel memory to find out what IPC objects exist and their state, but when run as a normal user, it doesn't have permissions to do so and fails silently;ipcs
always returns that nothing's allocated, whileipcs -T
reports garbage values.Talking of
ipcs -T
, the IPC system limits are (as usual) set via sysctls. But if you try and change them, they refuse to alter. It turns out that you can set them, but only once - the first time this set of sysctls is written to the kernel, it sets up its internal data structures and considers the sysctls read-only thereafter until the next boot.
You have been warned.
I'm reporting the former at least to Apple as a bug...
By Andy, Fri 16th Feb 2007 @ 4:20 pm
Hi,
How's tricks?
Whatcha workin' on these days?
Speak soon.
Regards, @ndy