[net.unix-wizards] Shared Memory on System V

bernard@imag.UUCP (Bernard CASSAGNE) (04/30/86)

When reading "shmat(2)" specification, it seems possible :

a) To attach a segment of length N at address A
b) To attach a second segment at address A+N
c) To address the two segments as a contiguous space.

This is impossible on a 3B2 machine, but seems possible when reading
source kernal files for VAX.

Is there any ATT specification about such usage of shared memory ?

Thank you for all ideas by mailing thru :
UUCP :  ...seismo!mcvax!vmucnam!imag!bernard

ka@hropus.UUCP (Kenneth Almquist) (05/15/86)

> When reading "shmat(2)" [actually shmop(2)] specification, it seems possible:
> a) To attach a segment of length N at address A
> b) To attach a second segment at address A+N
> c) To address the two segments as a contiguous space.
>
> Is there any ATT specification about such usage of shared memory ?

I think that the manual page covers this.  Step (a) is permissible.
Step (b) is permissible unless A+N is an "illegal address".  What
constitutes an "illegal address" is hardware dependent.  Step (c) is
permissible as far as I can see.

The requirement that A+N be a legal address makes this usage of memory
nonportable.  On some systems, such as the VAX, a legal address is one
which falls on a page boundary, and so you must know the page size to
generate a suitable value of N.  On other systems, a legal address is
one which falls on a segment boundary, which may make this approach
impossible.  A hardware designer might decide to divide a 32 bit address
space into 64 segments, in which case each segment would have to be on
a 32 megabyte boundary.  I doubt if there are any UNIX systems which
will allow you to create a 32 megabyte segment.
				Kenneth Almquist
				ihnp4!houxm!hropus!ka	(official name)
				ihnp4!opus!ka		(shorter path)