Subject: Re: Quick hack to implement gethostbyname_r() through gethostbyname()+mutex lock
From: "Enzo Michelangeli" <[email-masked]>
To: <[email-masked]>
Cc: <[email-masked]>
Date: Thu, 15 Apr 2004 21:21:57 +0800

From: "Dave Korn" <dk at artimi dot com>
To: <cygwin at cygwin dot com>
Date: Thu, 15 Apr 2004 14:02:38 +0100
Subject: RE: Quick hack to implement gethostbyname_r() through
gethostbyname()+mutex lock
[...]
>> Well, OK, here is the code, hereby placed in the public
>> domain. Everybody
>> can do with it whatever s/he likes; attribution will be
>> appreciated. Of
>> course, no guarantees etc.

> Ah, but it's not a matter of it having no copyright, but
> of the copyright existing and belonging to the FSF so that
> the GPL can be enforced on the file.  If you submit a
> completely PD bit of source to a GPL project, other
> people can take that code, modify it and release it as
> binaries without being obliged by the GPL to provide sources,
> because they can claim they're working on your PD version
> rather than any version distributed under GPL.
> IOW, making code PD makes it impossible to apply and enforce
> the GPL to it.

I know, but as I said I don't think that the approach I followed is anyway
the right one of implementing a gethostbyname_r() made for inclusion in a
system library. The proper thing to do is to start with a fully reentrant
gethostbyname_r(), and then, in case, use it to implement gethostbyname()
using a local static buffer and a call to gethostbyname_r(): that would
avoid unnecessary blocks of other threads calling the same function. On
the other hand, I thought that my code may still be useful as a stopgap
measure linked to a calling application, ad that's why I released it to
the general public. And I don't care if it, or derivative work, will not
be protected by GPL.

Enzo

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/