• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Equivalent of gethostbyname_r for Mac OS X?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Equivalent of gethostbyname_r for Mac OS X?


  • Subject: Re: Equivalent of gethostbyname_r for Mac OS X?
  • From: Tron Thomas <email@hidden>
  • Date: Tue, 02 May 2006 21:01:10 -0700

I know that gethostbyname is not re-entrant. That is why I was asking if there was another re-entrant alternative that could be used. What is the reason there is no re-entrant equivalent for gethostbyname?

Dale Walsh wrote:

On May 2, 2006, at 21:18 , Tron Thomas wrote:

I work on a cross platform project that is multithreaded. The code base wants to call gethostbyname_r as a thread safe way of connecting to a host sever. However, this function is not supported on Mac OS X. What is the equivalent thread safe way to accomplish the same functionality?

The gethostbyname_r function can be replaced with gethostbyname, which is similar except that it is non-reentrant. Replacing a reentrant function with a non-reentrant function is not a favored alternative, as it can cause unpredictable and hard-to-trace bugs if the calling function doesn't terminate the call appropriately and take into consideration that the call itself might time out which would result in unpredictable behavior if this returned data is not tested/validated.






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden <mailto:email@hidden>)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden <mailto:email@hidden>




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Equivalent of gethostbyname_r for Mac OS X?
      • From: Dale Walsh <email@hidden>
References: 
 >Equivalent of gethostbyname_r for Mac OS X? (From: Tron Thomas <email@hidden>)
 >Re: Equivalent of gethostbyname_r for Mac OS X? (From: Dale Walsh <email@hidden>)

  • Prev by Date: Re: Equivalent of gethostbyname_r for Mac OS X?
  • Next by Date: Re: Equivalent of gethostbyname_r for Mac OS X?
  • Previous by thread: Re: Equivalent of gethostbyname_r for Mac OS X?
  • Next by thread: Re: Equivalent of gethostbyname_r for Mac OS X?
  • Index(es):
    • Date
    • Thread