Is to safe to do shmat without shmget?

Bjorn Engsig bengsig at oracle.nl
Wed May 17 21:23:55 AEST 1989


Is it safe to do the following (in all known Unix'es):

- Program 1 does a succesful create of a shared memory segment (shmget), 
  attaches to it (shmat), saves the shm identifier (NOT the key) in a 
  file, and the program stays alive.

- Program 2 reads the file, uses shmat only (NO shmget) to attach to
  the shared memory, and stays alive.

The real point is: Is it safe to attach to an existing shared memory (for
which you have the permission) using shmat with a known shmid, without
getting the shmid by a call to shmget?
-- 
Bjorn Engsig, ORACLE Europe         \ /    "Hofstadter's Law:  It always takes
Path:   mcvax!orcenl!bengsig         X      longer than you expect, even if you
Domain: bengsig at oracle.nl           / \     take into account Hofstadter's Law"



More information about the Comp.unix.wizards mailing list