Re: Libification project (SoC)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Schindelin <Johannes.Schindelin@...>
Cc: Petr Baudis <pasky@...>, Rocco Rutte <pdmef@...>, <git@...>
Date: Sunday, March 18, 2007 - 10:56 pm

On Mon, Mar 19, 2007 at 02:43:54AM +0100, Johannes Schindelin wrote:

Um, look at what we had to do with gethostbyname() and
gethostbyname_r().  It wasn't possible to sweep through and fix all of
the programs that used gethostbyname(), despite the fact that if a
program called gethostbyname(), then called library function which
unknowingly to application, could possibly do a DNS or YP lookup (and
whose behavior could change depending on some config file like
/etc/nsswitch.conf), which would blow away the static information.  So
if the application tryied to use the information returned by _its_
call to gethostbyname after calling some other library function, it
could get some completely random hostname that wasn't what it
expected.

Yelch!  And so we have two API's that libc has to support,
gethostbyname(), and gethostbyname_r(), with the ugly _r() suffix, and
which in a sane world most programs should use since otherwise they
can be incredibly fragile unless the _first_ thing they do after
calling gethostbyname is to copy the information to someplace stable,
instead of relying on the static buffer to remain sane.  (And yet they
don't, which means bugs that only show up if optional YP or Hesiod
lookups are enabled, etc.)

Berkely got it horribly wrong when it tried to start with the "small
and beautiful" functions that were non-reentrant, and we've been
paying the price ever since.  Do we really want to support two
versions of the API forever?  Is it really that hard to support a
reentrant API from the beginning?  I'd submit the answer to these two
questions are no, and no, respectively.

						- Ted
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Libification project (SoC), Luiz Fernando N. Capitulino..., (Fri Mar 16, 12:24 am)
Re: Libification project (SoC), Shawn O. Pearce, (Fri Mar 16, 12:59 am)
Re: Libification project (SoC), Petr Baudis, (Fri Mar 16, 8:55 am)
Re: Libification project (SoC), Junio C Hamano, (Fri Mar 16, 1:30 am)
Re: Libification project (SoC), Luiz Fernando N. Capitulino..., (Fri Mar 16, 9:47 am)
Re: Libification project (SoC), Johannes Schindelin, (Fri Mar 16, 11:16 am)
Re: Libification project (SoC), Petr Baudis, (Fri Mar 16, 10:08 am)
Re: Libification project (SoC), Luiz Fernando N. Capitulino..., (Fri Mar 16, 2:38 pm)
Re: Libification project (SoC), Shawn O. Pearce, (Fri Mar 16, 7:16 pm)
Re: Libification project (SoC), Luiz Fernando N. Capitulino..., (Sat Mar 17, 3:58 pm)
Re: Libification project (SoC), Shawn O. Pearce, (Sun Mar 18, 1:23 am)
Re: Libification project (SoC), Junio C Hamano, (Sun Mar 18, 1:52 am)
Re: Libification project (SoC), Luiz Fernando N. Capitulino..., (Sun Mar 18, 12:18 pm)
Re: Libification project (SoC), Nicolas Pitre, (Sun Mar 18, 5:15 pm)
Re: Libification project (SoC), Junio C Hamano, (Sun Mar 18, 3:31 pm)
Re: Libification project (SoC), Luiz Fernando N. Capitulino..., (Mon Mar 19, 12:09 pm)
Re: Libification project (SoC), Petr Baudis, (Fri Mar 16, 8:53 am)
Re: Libification project (SoC), Shawn O. Pearce, (Fri Mar 16, 2:00 am)
Re: Libification project (SoC), Junio C Hamano, (Fri Mar 16, 2:54 am)
Re: Libification project (SoC), Johannes Schindelin, (Fri Mar 16, 7:54 am)
Re: Libification project (SoC), Rocco Rutte, (Fri Mar 16, 9:09 am)
Re: Libification project (SoC), Johannes Schindelin, (Fri Mar 16, 11:12 am)
Re: Libification project (SoC), Petr Baudis, (Sun Mar 18, 10:08 am)
Re: Libification project (SoC), Johannes Schindelin, (Sun Mar 18, 7:48 pm)
Re: Libification project (SoC), Petr Baudis, (Sun Mar 18, 9:21 pm)
Re: Libification project (SoC), Johannes Schindelin, (Sun Mar 18, 9:43 pm)
Re: Libification project (SoC), Marco Costalba, (Mon Mar 19, 3:01 am)
Re: Libification project (SoC), Johannes Schindelin, (Mon Mar 19, 8:37 am)
Re: Libification project (SoC), Marco Costalba, (Mon Mar 19, 9:04 am)
Re: Libification project (SoC), Petr Baudis, (Mon Mar 19, 8:52 am)
Re: Libification project (SoC), Johannes Schindelin, (Mon Mar 19, 9:55 am)
Re: Libification project (SoC), Steve , (Mon Mar 19, 6:33 am)
Re: Libification project (SoC), Steve , (Mon Mar 19, 5:46 am)
Re: Libification project (SoC), Theodore Tso, (Sun Mar 18, 10:56 pm)
Re: Libification project (SoC), Linus Torvalds, (Mon Mar 19, 12:28 pm)
Re: Libification project (SoC), Andreas Ericsson, (Wed Mar 21, 7:17 am)
Re: Libification project (SoC), Linus Torvalds, (Wed Mar 21, 1:24 pm)
Re: Libification project (SoC), Andreas Ericsson, (Thu Mar 22, 5:51 am)
Re: Libification project (SoC), Linus Torvalds, (Mon Mar 19, 12:32 pm)
Re: Libification project (SoC), Johannes Schindelin, (Mon Mar 19, 10:57 am)
Re: Libification project (SoC), Shawn O. Pearce, (Sun Mar 18, 11:55 pm)
Re: Libification project (SoC), Marco Costalba, (Fri Mar 16, 2:20 pm)
Re: Libification project (SoC), Marco Costalba, (Fri Mar 16, 2:38 pm)
Re: Libification project (SoC), Andy Parkins, (Fri Mar 16, 3:09 pm)
Re: Libification project (SoC), Nicolas Pitre, (Fri Mar 16, 2:59 pm)
Re: Libification project (SoC), Marco Costalba, (Fri Mar 16, 5:07 pm)
Re: Libification project (SoC), Johannes Schindelin, (Fri Mar 16, 7:24 pm)
Re: Libification project (SoC), Marco Costalba, (Sat Mar 17, 3:04 am)
Re: Libification project (SoC), Johannes Schindelin, (Sat Mar 17, 1:29 pm)
Re: Libification project (SoC), Nicolas Pitre, (Fri Mar 16, 11:55 am)
Re: Libification project (SoC), Shawn O. Pearce, (Fri Mar 16, 12:17 pm)
Re: Libification project (SoC), Johannes Schindelin, (Fri Mar 16, 12:13 pm)
Re: Libification project (SoC), Nicolas Pitre, (Fri Mar 16, 12:26 pm)
Re: Libification project (SoC), Johannes Schindelin, (Fri Mar 16, 7:26 pm)
Re: Libification project (SoC), Steve , (Fri Mar 16, 2:22 pm)
Re: Libification project (SoC), Nicolas Pitre, (Fri Mar 16, 2:53 pm)
Re: Libification project (SoC), Petr Baudis, (Sun Mar 18, 9:57 am)