[comp.unix.internals] Shared memory

benson@odi.com (Benson I. Margulies) (12/12/90)

I'm on the verge of coding a simple use of the shm system call
family on a system that dosen't supply the more modern mapping 
calls. The question is -- how to pick segment id's that are 
not going to collide with other, unrelated applications? Calling
ftok(3) is fine, so long as anyone does it. But there seems no guarantee
that some other rogue elephant won't go and stir up one of those
bitpatterns. Has anyone else wrestled this item?
-- 
Benson I. Margulies

chip@tct.uucp (Chip Salzenberg) (12/13/90)

According to benson@odi.com (Benson I. Margulies):
>I'm on the verge of coding a simple use of the shm system call
>family on a system that dosen't supply the more modern mapping 
>calls.

System V IPC keys are Evil and Rude.  Don't use them.  Specify
IPC_PRIVATE as the key, then store the id in a place known to your
application.
-- 
Chip Salzenberg at Teltronics/TCT     <chip@tct.uucp>, <uunet!pdn!tct!chip>
"What's that thing, when people die, they take apart the body to see why?"
	       -- St. Theresa of the Net