struct hostent hostbuf, *hp; size_t buflen; char *buffer; u_int32_t addr; char **ap; int herr;  buflen = 1024; buffer = __alloca (buflen);  while (__gethostbyname_r (rhost, &hostbuf, buffer, buflen, &hp, &herr) != 0 || hp == NULL) if (herr != NETDB_INTERNAL || errno != ERANGE) return -1; else {  buflen *= 2; buffer = __alloca (buflen); }  for (ap = hp->h_addr_list; *ap; ++ap) { bcopy(*ap, &addr, sizeof(addr)); if (iruserok2(addr, superuser, ruser, luser, rhost) == 0) return 0; } return -1;
return ruserok_af(rhost, superuser, ruser, luser, AF_INET);
ruserok(rhost, superuser, ruser, luser)	const char *rhost, *ruser, *luser;	int superuser;{	struct hostent hostbuf, *hp;	size_t buflen;	char *buffer;	u_int32_t addr;	char **ap;	int herr;	buflen = 1024;	buffer = __alloca (buflen);	while (__gethostbyname_r (rhost, &hostbuf, buffer, buflen, &hp, &herr)	       != 0	       || hp == NULL)	  if (herr != NETDB_INTERNAL || errno != ERANGE)	    return -1;	  else	    {	      /* Enlarge the buffer.  */	      buflen *= 2;	      buffer = __alloca (buflen);	    }	for (ap = hp->h_addr_list; *ap; ++ap) {		bcopy(*ap, &addr, sizeof(addr));		if (iruserok2(addr, superuser, ruser, luser, rhost) == 0)			return 0;	}	return -1;}