Re: [PATCH] index-pack usage of mmap() is unacceptably slower on many OSes other than Linux
- From
Nicolas Pitre <nico@cam.org>
- Date
- Dec 19, 2006, 19:14 UTC
- Message-ID
- <Pine.LNX.4.64.0612191409500.18171@xanadu.home>
- In-Reply-To
- <7vk60npv7x.fsf@assigned-by-dhcp.cox.net>
On Tue, 19 Dec 2006, Junio C Hamano wrote:
Show 23 quoted lines
> > diff --git a/index-pack.c b/index-pack.c > > index 6d6c92b..e08a687 100644 > > --- a/index-pack.c > > +++ b/index-pack.c > > @@ -1,3 +1,8 @@ > > +#define _XOPEN_SOURCE 500 > > +#include <unistd.h> > > +#include <sys/time.h> > > +#include <signal.h> > > + > > #include "cache.h" > > #include "delta.h" > > #include "pack.h" > > @@ -6,8 +11,6 @@ > > #include "commit.h" > > #include "tag.h" > > #include "tree.h" > > -#include <sys/time.h> > > -#include <signal.h> > > Most of the rest of the sources seem to do our includes first > and source-file specific system includes at the end. What's the > rationale for this change?
Because _XOPEN_SOURCE must be defined before including unistd.h otherwise pread is not declared and a warning is issued.
> Do we need _XOPEN_SOURCE=500 because pread() is XSI?
The pread man page says Unix98.
> Also nobody other than convert-objects.c has _XOPEN_SOURCE level > specified. If _XOPEN_SOURCE matters I wonder if we should do so > in some central place to make it consistent across source files?
Your call I guess.