shared memory
Conor P. Cahill
cpcahil at virtech.uucp
Thu Sep 27 09:08:57 AEST 1990
In article <14140 at hydra.gatech.EDU> gt0178a at prism.gatech.EDU (BURNS,JIM) writes:
>HP-UX documents it; it tests out on A/UX 1.1 and Ultrix 4.0 : the first
>call to shmat() (by any process) automatically zeroes out the shm seg, so
>explicit initialization is NOT necessary. Is this standard? Which one?
This is a basic rule of unix:
All memory given to a program by the kernel must be cleared to
zero. This applies to new sbrk()'d areas (not always to areas that
you previously had and then released and then got back) uninitialized
static data areas, and shared memory segments. It even applies to stack
the first time it is used.
This is a security measure (makes sure you can't see someone elses data).
Note that it also applies to disk "memory" (if you seek past the end of a
file, write a byte, seek back to the skipped portion and read, you will get
all nulls).
--
Conor P. Cahill (703)430-9247 Virtual Technologies, Inc.,
uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160
Sterling, VA 22170
More information about the Comp.unix.programmer
mailing list