Re: [PATCH] index-pack usage of mmap() is unacceptably slower on many OSes other than Linux
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 20, 2006, 21:52 UTC
- Message-ID
- <7v1wmu8cbw.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0612201243490.3576@woody.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 9 quoted lines
> On Wed, 20 Dec 2006, Junio C Hamano wrote: >> >> I needed to fix the changes to git-compat-util.h a bit from the >> version I sent earlier to make OpenBSD happy (sys/types.h there >> did not expose u_int unless _BSD_SOURCE was set, and >> netinet/in.h was duplicated by mistake). > > Please don't use "u_int" in the first place. It's an abomination of a > type. It should never be used.
I did not want to touch imported sources in compat/, but
Show 7 quoted lines
> The only user in git seems to have been copied from a source that is > insane. It does > > u_int words[NS_IN6ADDRSZ / NS_INT16SZ]; > > which is just insane. It actually seems to want to use "uint16_t", which > at least would make sense, and be a type that has some _point_ to it.
the above argument makes 100% sense. Will fix.
However, on sane platforms we do not even compile that file. The problem I observed was that <include/netinet/tcp.h> on OpenBSD uses u_int wants the source code that uses that header file to first include <sys/types.h> to get u_int, which in turn requires __BSD_VISIBLE to be in effect.
Unfortunately I think _BSD_SOURCE needs to stay for this reason.