delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/05/17:04:00

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Wed, 5 May 2004 17:03:40 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: pthreads and sockets - Cannot register window class error
Message-ID: <20040505210340.GB321@coe.bosbc.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4098760F DOT CDB4F630 AT hot DOT pl> <4098E04B DOT 34D2866B AT dessent DOT net>
Mime-Version: 1.0
In-Reply-To: <4098E04B.34D2866B@dessent.net>
User-Agent: Mutt/1.4.1i

On Wed, May 05, 2004 at 05:38:35AM -0700, Brian Dessent wrote:
>Jacek Trzmiel wrote:
>
>> void test()
>> {
>>     /* go find out about the desired host machine */
>>     struct hostent *he = gethostbyname(HOST);
>>     if (he == 0) {
>>         perror("gethostbyname");
>>         exit(1);
>>     }
>
>Just a wild guess, but gethostbyname() is probably not reentrant and
>can't be called from threads like that.

Unless HOST is a numeric IP address, gethostbyname should be properly
reentrant.  The only time gethostbyname is not thread safe is when it is
resolving a numeric IP.

cgf

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