Re: Re: [PATCHES] A patch for xlog.c
От | Ian Lance Taylor |
---|---|
Тема | Re: Re: [PATCHES] A patch for xlog.c |
Дата | |
Msg-id | sibsrpqt5n.fsf@daffy.airs.com обсуждение исходный текст |
Ответ на | [PATCHES] A patch for xlog.c (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | pgsql-hackers |
Tom Lane <tgl@sss.pgh.pa.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
В списке pgsql-hackers по дате отправления: