This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Glibc: _POSIX_MAPPED_FILES & Hurd
- To: drepper@gnu.org
- Subject: Glibc: _POSIX_MAPPED_FILES & Hurd
- From: Mark Kettenis <kettenis@phys.uva.nl>
- Date: Thu, 6 Aug 1998 18:12:40 +0200 (CEST)
- CC: libc-hacker@cygnus.com
Hi,
I have some questions/remarks considering the following change:
1998-08-03 16:36 Ulrich Drepper <drepper@cygnus.com>
* catgets/catgets.c: Use mmap/munmap only is _POSIX_MAPPED_FILES
is defined.
* catgets/open_catalog.c: Likewise.
* iconv/iconv_prog.c: Likewise.
* intl/loadmsgcat.c: Likewise.
* locale/findlocale.c: Likewise.
* locale/loadlocale.c: Likewise.
* locale/programs/localedef.c: Likewise.
* malloc/malloc.c: Likewise.
The comment in `unistd.h' says
If these symbols are defined, the corresponding features are
always available. If not, they may be available sometimes.
The current values can be obtained with `sysconf'.
So _POSIX_MAPPED_FILES is only defined if mapping of files to memory
is supported for ALL filesystems. Thus even if _POSIX_MAPPED_FILES is
not defined mmap/munmap may work fine in most cases. For example, on
the Hurd mmap is not (yet) supported for NFS but is supported for UFS
and EXT2FS.
Besides, the check is hardly relevant for malloc, since malloc does
not mmap files if anonymous mapping is supported. And if anonymous
mapping is not supported, only `/dev/zero' is mapped, which is likely
to work even if _POSIX_MAPPED_FILES is undefined.
I think it is better to revert the patch, and add
CPPFLAGS-malloc.c += -DHAVE_MMAP=0
to the system dependent Makefiles of those ports that really do not
support mapping of `/dev/zero'.
Mark