www.delorie.com/gnu/docs/GNU/standards_31.html   search  
Buy GNU books!

GNU Coding Standards

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.9 Mmap

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.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003