From kde-core-devel Thu Mar 01 10:42:20 2007 From: Stephan Kulow Date: Thu, 01 Mar 2007 10:42:20 +0000 To: kde-core-devel Subject: Re: RFC: Drop notice: KNetwork Message-Id: <200703011142.21329.coolo () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=117274577330106 Am Donnerstag 01 März 2007 schrieb Andreas Aardal Hanssen: > On Thursday 01 March 2007 10:49, Thiago Macieira wrote: > > >QHostInfo uses gethostbyname(), which immediately adopts to changes > > >in /etc/resolv.conf. > > > > I don't think it does. That's exactly why the res_init call was added > > over 6 years ago: > > I've taken a look at QHostInfo code and I know why it appears to work: > > it's threaded. And on Linux/glibc, the resolver status is kept > > per-thread. So every time the thread dies and starts again, res_init is > > automatically called by glibc itself. > > QHostInfo::fromName() doesn't use threads. It just works. > > If you think of it, it just makes sense. Why should everyone who uses > gethostbyname() have to know that occasionally, they have to call > res_init()? > Who said POSIX follows logic? If you want something that works, you will have to adopt to the world ;( Greetings, Stephan