Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!agate!linus!nixbur!nixpbe!peun11!josef From: josef@nixpbe.UUCP (Moellers) Newsgroups: comp.unix.internals Subject: Re: shmat() & shmdt() questions. Message-ID: Date: 17 Sep 90 06:51:11 GMT References: <24482@adm.BRL.MIL> Sender: news@nixpbe.nixdorf.de Lines: 31 In <24482@adm.BRL.MIL> TAYBENGH%NUSDISCS.BITNET@cunyvm.cuny.edu writes: > I have 3 questions regarding usage of shared memory: > 1) can a child process inherit shmid from parent? i.e. does the shmid >valid in the following program segment? [example deleted] - the manual sais that children inherit any ATTACHED shared memory segments (SMSs) - the shmid is just an id which is bound to the SMS, so it should make no difference whether the parent hands the shmid to it's child or the child gets the shmid itself. > 2) can a child inherit the virtual address return by shmat()? [code example deleted] see my first remark on question 1. > 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 (if the OS is programmed properly B-{) > Thanks a lot for the help. Hope it was any. -- | Josef Moellers | c/o Nixdorf Computer AG | | USA: mollers.pad@nixdorf.com | Abt. PXD-S14 | | !USA: mollers.pad@nixdorf.de | Heinz-Nixdorf-Ring | | Phone: (+49) 5251 104662 | D-4790 Paderborn |