Skip site navigation (1) Skip section navigation (2)

Re: Re: [PATCHES] A patch for xlog.c

From: Ian Lance Taylor <ian(at)airs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [PATCHES] A patch for xlog.c
Date: 2001-02-26 16:57:08
Message-ID: sibsrpqt5n.fsf@daffy.airs.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> > Since mmap() is how everybody implements shared libraries,
> 
> Now *there's* a sweeping generalization.  Documentation of this
> claim, please?

I've seen a lot of shared library implementations (I used to be the
GNU binutils maintainer), and Nathan is approximately correct.  Most
ELF systems use a dynamic linker inherited from the original SVR4
implementation, which uses mmap.  You can see this by running strace
on an SVR4 system.  The *BSD and GNU dynamic linker implementations
are of course independently derived, but they use mmap too.

mmap is the natural way to implement ELF style shared libraries.  The
basic operation you have to do is to map the shared library into the
process memory space, and then to process a few relocations.  Mapping
the shared library in can be done either using mmap, or using
open/read/close.  For a large file, mmap is going to be much faster
than open/read/close, because it doesn't require actually reading the
file.

There are, of course, many non-ELF shared libraries implementations.
SVR3 does not use mmap.  SunOS does use mmap (SunOS shared libraries
were taken into SVR4 and the ELF standard).  I don't know offhand
about AIX, Digital Unix, or Windows.

mmap is standardized by the most recent version of POSIX.1.

Ian

In response to

pgsql-hackers by date

Next:From: Jan WieckDate: 2001-02-26 17:16:19
Subject: Re: ExecOpenScanR: failed to open relation
Previous:From: Tom LaneDate: 2001-02-26 16:23:25
Subject: Re: Re: [PATCHES] A patch for xlog.c

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group