Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!rochester!ur-tut!ur-valhalla!micropen!dave From: dave@micropen.UUCP Newsgroups: comp.unix.wizards Subject: Re: Question about Sys V shared memory Message-ID: <167@micropen> Date: Wed, 25-Mar-87 09:31:58 EST Article-I.D.: micropen.167 Posted: Wed Mar 25 09:31:58 1987 Date-Received: Fri, 27-Mar-87 01:32:29 EST References: <314@nbc1.UUCP> Organization: Micropen Direct Writing Systems, Pittsford, NY Lines: 22 Summary: relative addressing In article <314@nbc1.UUCP>, abs@nbc1.UUCP (Andrew Siegel) writes: > The question: > > If process A attaches the shm segment and assigns an address within > the segment's memory pool to one of these pointers, will this > address have any meaning to other processes that attach the > segment? > At least in Sys V, I would have each process call the allocator with a pointer to the beginning of the shm ( the pointer returned to the process at the attach). Then, the allocator routine would allocate the memory and pass back a pointer with the appropriate displacement into the segment. Thus, addressing within the shm region is relative to the virtual address that each process holds on the segment. And K&R say that pointer/integer arithmetic is cool (although some machines like Intel or pdp's will place a limit on the size of memory in any one segment but your nice VAX won't care a bit.) -- David F. Carlson, Micropen, Inc. ...!{seismo}!rochester!ur-valhalla!micropen!dave "The faster I go, the behinder I get." --Lewis Carroll