if (number == INET_IP) return (&sIPProto);  if (number == INET_TCP) return (&sTCPProto);  if (number == INET_UDP) return (&sUDPProto);
OSStatus err; PRUint32 index; PRThread *me = _PR_MD_CURRENT_THREAD();  _MD_FinishInitNetAccess();  me->io_pending       = PR_TRUE; me->io_fd            = NULL; me->md.osErrCode     = noErr;  PR_Lock(dnsContext.lock); dnsContext.thread = me;  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);
PR_IMPLEMENT(struct protoent *) getprotobynumber(int number){    if (number == INET_IP)        return (&sIPProto);            if (number == INET_TCP)        return (&sTCPProto);            if (number == INET_UDP)        return (&sUDPProto);        ErrorExit:    macsock_map_error(kEINVALErr);    return NULL;}