From: Linus Torvalds Date: Sun, 11 Sep 2005 18:07:06 GMT Subject: Re: Status of Mac OS/X ports of git and cogito? Message-ID: In-Reply-To: <7vvf17tsoa.fsf@assigned-by-dhcp.cox.net> On Sun, 11 Sep 2005, Junio C Hamano wrote: > Johannes Schindelin writes: > > > I have three fixes in my personal tree without which git refuses to > > compile: > > > > - daemon.c needs a define or typedef for socklen_t. > > I still keep that patch around (the patch was end of July), but > have not touched it only because I did not hear from you asking > about its inclusion. Side note: one simple solution for "socklen_t" is to just replace it with "int". Any operating system where socklen_t is anything else than "int" is terminally broken. The people who introduced that typedef were confused, and I actually had to argue with them that it was fundamentally wrong: there is no other valid type than "int" that makes sense for it. In case anybody cares: not only is "int" obviously "big enough" even on some theoretical 16-bit architecture, so there's never any real _reason_ to use anything else. But more importantly, the core BSD networking functions have historically had declarations like int accept(int s, struct sockaddr *addr, int *addrlen); which means that if 'socklen_t' is ever anything else than "int", you'd break all old applications. For no good reason. Ergo, any operating system that has socklen_t != int is so broken that it's simply not worth playing with. (POSIX for a short while had _defined_ it to be the same as "size_t", I really had to scream at some people over it, and told people that Linux would never do anything that stupid. Apparently Linux was the first 64-bit operating system that people actually ever tried to use). Linus