I wrote:
> it appears from your report that OS X is also using ENOMEM when SHMALL
> is exceeded, which is not all that surprising because actually none of
> the spec-defined error codes cover SHMALL exhaustion.
A look into
http://www.opensource.apple.com/source/xnu/xnu-1504.7.4/bsd/kern/sysv_shm.c
confirms this:
if ((user_ssize_t)(shm_committed + btoc(total_size)) > shminfo.shmall) return ENOMEM;
So this behavior is probably common among BSDen.
regards, tom lane