From: Linus Torvalds (torvalds@klaava.Helsinki.FI)
Date: 08/08/93


From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
Subject: Re: status of mmap(2) in Linux
Date: 8 Aug 1993 15:11:27 +0300

In article <241gc8$d60@samba.oit.unc.edu> ses@sunSITE.unc.edu (Simon Spero) writes:
>Can anybody tell me the current status of mmap in Linux? Last I heard
>it only worked for a few special cases, but not for general files. Has this
>changed, and if so, which kernels is it available in?

In 0.99.11 (and even more so in pl12), the mmap() facility should work
for all normal files on the "unixy" filesystems (ie minix, ext, ext2,
xiafs) as long as you don't try to write to a file with mmap() - ie the
MAP_PRIVATE mappings should be ok (probably MAP_SHARED with just
PROT_READ is also ok). In fact, pl12 (alpha) uses mmap() internally
both for normal executables and shared libraries.

The full MAP_SHARED mapping semantics will probably not be implemented
for some time, nor the full mmap()-related things (mprotect(), msync()
etc). They'll get there eventually, but so far just the read-mapping
has enabled some internal mm cleanups and is often enough for a lot of
things.

                        Linus