Parent document is top of "comp.unix.aix Frequently Asked Questions (Part 4 of 5)"
Previous document is "2.23: What is Linker TOC overflow error 12?"
Next document is "2.25: I deleted libc.a by accident --- how do I recover?"

2.24: What is the limit on number of shared memory segments I can attach?

Each process has 16 segments.  One is used for private code, one for
stack, one for heap; those, if memory serves, are segments 0, 1, and
2.  (If you look in sys/shm.h, you'll see that SHMLOSEG is 3 -- the
lowest segment, in number and in the process' virtual address space,
available to shmat.)

SHMHISEG, the highest segment you can attach to (also defined in
sys/shm.h), is 12.  Segments 3 through 12 are available to shmat,
giving the 10 segments your program used successfully.  (NSHMSEGS in
sys/shm.h will give you this value, though it's of limited use, since
most platforms that I've seen don't define it.)

Segment 13 is used by shared code your program has attached to;
I think one of the others might be for kernel-mode data.

See also mmap.

Parent document is top of "comp.unix.aix Frequently Asked Questions (Part 4 of 5)"
Previous document is "2.23: What is Linker TOC overflow error 12?"
Next document is "2.25: I deleted libc.a by accident --- how do I recover?"