System V IPC on Mac OS X is a bit funny (by )

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.

  1. 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, while ipcs -T reports garbage values.

  2. 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...

1 Comment

  • By Andy, Fri 16th Feb 2007 @ 4:20 pm

    Hi,

    How's tricks?

    Whatcha workin' on these days?

    Speak soon.

    Regards, @ndy

Other Links to this Post

RSS feed for comments on this post.

Leave a comment

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales