delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/05/24/08:24:30

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <5p5klh$kbta4 AT rrcs-agw-01 DOT hrndva DOT rr DOT com>
Subject: RE: gcc 3.3 vs 3.4.4 - netdb.h different
Date: Thu, 24 May 2007 13:22:47 +0100
Message-ID: <001a01c79dfe$3d0e2660$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <5p5klh$kbta4@rrcs-agw-01.hrndva.rr.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 23 May 2007 21:26, Karl Kobata wrote:

> I am compiling an application found on sourceforge that was compile on
> cygwin using gcc 3.3.  Since we are compiling all of our application with
> gcc 3.4.4, I am recompiling the application and find that it is not able to
> find int declarations such as getnetbyname_r or gethostbyaddr_r or
> gethostbyname_r and others that did exist in netdb.h.

  This is nothing to do with the compiler.  That file is part of the main
cygwin package itself.  AFAIK, cygwin supports only gethostbyaddr and
gethostbyname, in their plain forms, and not in the re-entrant _r versions.
From a quick look at the code, these functions are thread-safe, having a
separate buffer for return results in each thread, but they will overwrite the
previous data each time called, so it does seem like you need to patch up the
code you're compiling to use the non-re-entrant versions, or provide your own
_r wrappers that call the non-_r version and then copy the returned result
into the provided buffer.  (Note that this is a little tricky because you have
to calculate the size of the returned data, but you could model your approach
on __dup_ent in net.cc in the cygwin source code).

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019