Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <007b01c422ec$ac199340$0200a8c0@em.noip.com> From: "Enzo Michelangeli" To: Cc: Subject: Re: Quick hack to implement gethostbyname_r() through gethostbyname()+mutex lock Date: Thu, 15 Apr 2004 21:21:57 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit From: "Dave Korn" To: 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/