shmat() & shmdt() questions.

Jay Logue jay at retix.retix.retix.com
Sat Sep 15 06:19:54 AEST 1990


In article <1990Sep13.121318.24305 at virtech.uucp>, cpcahil at virtech.uucp
(Conor P. Cahill) writes:

>In article <24482 at adm.BRL.MIL> TAYBENGH%NUSDISCS.BITNET at cunyvm.cuny.edu writes:
>
> [ ... ]
>
>>        3) if a process quit without shmdt() the shared memory it attached
>>to, will the OS detect and decrement the shm_nattch in structure sgmid_ds?
>
>Yes.  And if this segment is designed to be a temporary segment that is 
>supposed to be removed when the last program is done with it, you can
>run shmctl(... IPC_RM) once you have attached to it and then it will
                ^^^^^^
>be removed when the total number of attached processes drops to zero.

What is IPC_RM?  It is not mentioned in my AT&T System V/386 book nor
is it present in any of the header files on my SCO Unix 386 system.
The closest shmctl command value listed in the AT&T book is IPC_RMID,
which is used to remove the shmid along with the shared memory
segment.

This sounds to me like an added feature of your Un*x.  The ability to
have a "temporary" shared memory segment would be great but I don't
think standard System V R3 provides this.


Jay Logue

===============================================================================
Retix

USMail: 2644 30th Street, Santa Monica, CA 90405-3009 U.S.A
   Tel:	(213) 399-1611
   Fax:	(213) 458-2685
 Telex: 4944307
E-mail:	jay at retix.com
 X.400:	C=US;ADMD=TELEMAIL;PRMD=RETIX;O=OSI ONE;S=LOGUE;G=JAY
===============================================================================



More information about the Comp.unix.internals mailing list