if (!gOTInitialized) _MD_FinishInitNetAccess();
PR_IMPLEMENT(struct hostent *) gethostbyname(const char * name){    OSStatus err;    PRUint32 index;    PRThread *me = _PR_MD_CURRENT_THREAD();    me->io_pending       = PR_TRUE;    me->io_fd            = NULL;    me->md.osErrCode     = noErr;		PR_Lock(dnsContext.lock);	// so we can safely store our thread ptr in dnsContext	dnsContext.thread = me;		// so we know what thread to wake up when OTInetStringToAddress completes    err = OTInetStringToAddress(dnsContext.serviceRef, (char *)name, &sHostInfo);    if (err != kOTNoError) {        me->io_pending = PR_FALSE;        me->md.osErrCode = err;        goto ErrorExit;    }    WaitOnThisThread(me, PR_INTERVAL_NO_TIMEOUT);	PR_Unlock(dnsContext.lock);    if (me->md.osErrCode != kOTNoError)        goto ErrorExit;    sHostEnt.h_name = sHostInfo.name;    for (index=0; index<kMaxHostAddrs && sHostInfo.addrs[index] != NULL; index++)        sAddresses[index] = &sHostInfo.addrs[index];    sAddresses[index] = NULL;        sHostEnt.h_addr_list = (char **)sAddresses;    return (&sHostEnt);ErrorExit:    return NULL;}