[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: casefile implementation

From: Ben Pfaff
Subject: Re: casefile implementation
Date: Mon, 30 May 2005 19:10:55 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> writes:

> I wondered if it wouldn't be possible to use the mmap system call to 
> greatly simplify the implementation of casefile.c

I don't want to depend on mmap.  It's not available everywhere,
and even where it is it might not work on every file system.

The GNU coding standards address this:

    Don't assume that `mmap' either works on all files or fails for all
    files.  It may work on some files and fail on others.

       The proper way to use `mmap' is to try it on the specific file for
    which you want to use it--and if `mmap' doesn't work, fall back on
    doing the job in another way using `read' and `write'.

       The reason this precaution is needed is that the GNU kernel (the
    HURD) provides a user-extensible file system, in which there can be many
    different kinds of "ordinary files."  Many of them support `mmap', but
    some do not.  It is important to make programs handle all these kinds
    of files.
"...Slashdot is built on loyalty and trust, not on traditional
 business precepts."
--Robin Miller

reply via email to

[Prev in Thread] Current Thread [Next in Thread]