git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Status of Mac OS/X ports of git and cogito?

From
Linus Torvalds <torvalds@osdl.org>
Date
Sep 11, 2005, 18:07 UTC
Message-ID
<Pine.LNX.4.58.0509111100260.3242@g5.osdl.org>
In-Reply-To
<7vvf17tsoa.fsf@assigned-by-dhcp.cox.net>
On Sun, 11 Sep 2005, Junio C Hamano wrote:
Show 10 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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
Previous: Johannes SchindelinNext: Junio C Hamano
Message 11 of 22 in “Status of Mac OS/X ports of git and cogito?”
  1. John EllsonAug 27, 2005
  2. Junio C HamanoAug 27, 2005
  3. Johannes SchindelinSep 11, 2005
  4. Martin LanghoffSep 11, 2005
  5. Johannes SchindelinSep 11, 2005
  6. Junio C HamanoSep 11, 2005
  7. Linus TorvaldsSep 11, 2005
  8. A Large Angry SCMSep 11, 2005
  9. Junio C HamanoSep 11, 2005
  10. Johannes SchindelinSep 11, 2005
  11. Linus TorvaldsSep 11, 2005
  12. Use int instead of socklen_tJunio C Hamano, Sep 11, 2005
  13. Johannes SchindelinSep 11, 2005
  14. Linus TorvaldsSep 11, 2005
  15. Linus TorvaldsSep 11, 2005
  16. Johannes SchindelinSep 12, 2005
  17. Daniel BarkalowSep 11, 2005
  18. Martin LanghoffSep 11, 2005
  19. Johannes SchindelinSep 11, 2005
  20. Martin LanghoffAug 27, 2005
  21. Martin LanghoffAug 29, 2005
  22. Martin LanghoffAug 30, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.