Switch git_mmap to use pread.
commit8e554429e8a9dbb5dba6b8aeca66fc27c0bb5538
authorShawn O. Pearce <spearce@spearce.org>
Sun, 24 Dec 2006 05:45:47 +0000 (24 00:45 -0500)
committerJunio C Hamano <junkio@cox.net>
Sun, 24 Dec 2006 08:29:43 +0000 (24 00:29 -0800)
treeadf7d910ef56f76cef598db30fec509b94c64d92
parentd6779124b90ef5c00697815b04c9f75fd3756586
Switch git_mmap to use pread.

Now that Git depends on pread in index-pack its safe to say we can
also depend on it within the git_mmap emulation we activate when
NO_MMAP is set.  On most systems pread should be slightly faster
than an lseek/read/lseek sequence as its one system call vs. three
system calls.

We also now honor EAGAIN and EINTR error codes from pread and
restart the prior read.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
compat/mmap.c