From owner-freebsd-hackers Sat Feb 8 09:28:34 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA21073 for hackers-outgoing; Sat, 8 Feb 1997 09:28:34 -0800 (PST) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id JAA21066 for ; Sat, 8 Feb 1997 09:28:31 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id SAA00903; Sat, 8 Feb 1997 18:27:04 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.6.9) id RAA28382; Sat, 8 Feb 1997 17:15:28 +0100 (MET) Message-ID: Date: Sat, 8 Feb 1997 17:15:27 +0100 From: j@uriah.heep.sax.de (J Wunsch) To: witr@rwwa.com (Robert Withrow) Cc: freebsd-hackers@freebsd.org Subject: Re: In what way are shared libs ``shared''? References: <199702081502.KAA29141@spooky.rwwa.com> X-Mailer: Mutt 0.55-PL10 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199702081502.KAA29141@spooky.rwwa.com>; from Robert Withrow on Feb 8, 1997 10:02:48 -0500 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As Robert Withrow wrote: > Looking at rtld.c I see: > > addr = mmap(0, hdr.a_text + hdr.a_data + hdr.a_bss, > PROT_READ|PROT_EXEC, MAP_COPY, fd, 0) > > >From my understanding of MAP_COPY semantics, this is *not* > a shared mapping. If I am right about this, then how > are shared libs shared? They are shared. MAP_COPY is an unsupported name for MAP_PRIVATE, and the explanation for MAP_PRIVATE says that *modifications* are private (COW). Since the mapping is with read and execute permissions only, the mapping program is not supposed to ever modify something. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)