Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!hao!ames!lll-lcc!pyramid!decwrl!sgi!archer
From: archer@elysium.SGI.COM (Archer Sully)
Newsgroups: comp.unix.wizards
Subject: Re: Motorola shared memory questions
Message-ID: <8508@sgi.SGI.COM>
Date: Fri, 27-Nov-87 23:08:19 EST
Article-I.D.: sgi.8508
Posted: Fri Nov 27 23:08:19 1987
Date-Received: Mon, 30-Nov-87 01:31:35 EST
References: <106600017@datacube> <5809@ncoast.UUCP>
Sender: daemon@sgi.SGI.COM
Organization: Silicon Graphics Inc, Mountain View, CA
Lines: 18
Summary: This doesn't always work

In article <5809@ncoast.UUCP>, allbery@ncoast.UUCP (Brandon Allbery) writes:

> You're trying to attach two pieces of memory to the same address.  The way to
> do this is to call shmat() with NULL the first time, then for the others
> pass the virtual address immediately following the end of the previous segment
> (i.e. for the second, pass the address returned by shmat() plus the size of
> the segment, and so on).
> -- 
> Brandon S. Allbery


Although Brandon doesn't mention it explicitly, there is a gotcha
here.  Shared segments need to be segment aligned, so if you try
this trick on small segments, terrible things will happen.  If the
segment size on you machine is smaller that SHMMAX, then you're really
in trouble.

archer