cache_addhst (db, fd, req, key, hst, uid);
cache_addhst (db, fd, req, key, hst, uid, 0);
addhstbynamev6 (struct database *db, int fd, request_header *req,		void *key, uid_t uid){  /* Search for the entry matching the key.  Please note that we don't     look again in the table whether the dataset is now available.  We     simply insert it.  It does not matter if it is in there twice.  The     pruning function only will look at the timestamp.  */  int buflen = 1024;  char *buffer = (char *) alloca (buflen);  struct hostent resultbuf;  struct hostent *hst;  uid_t oldeuid = 0;  bool use_malloc = false;  if (__builtin_expect (debug_level > 0, 0))    {      char buf[INET6_ADDRSTRLEN];      dbg_log (_("Haven't found \"%s\" in hosts cache!"),	       inet_ntop (AF_INET6, key, buf, sizeof (buf)));    }  if (secure[hstdb])    {      oldeuid = geteuid ();      seteuid (uid);    }  while (__gethostbyname2_r (key, AF_INET6, &resultbuf, buffer, buflen,  			     &hst, &h_errno) != 0	 && h_errno == NETDB_INTERNAL	 && errno == ERANGE)    {      char *old_buffer = buffer;      errno = 0;      buflen += 1024;      if (__builtin_expect (buflen > 32768, 0))	{	  buffer = (char *) realloc (use_malloc ? buffer : NULL, buflen);	  if (buffer == NULL)	    {	      /* We ran out of memory.  We cannot do anything but		 sending a negative response.  In reality this should		 never happen.  */	      hst = NULL;	      buffer = old_buffer;	      break;	    }	  use_malloc = true;	}      else	{	  buffer = (char *) alloca (buflen);#if _STACK_GROWS_DOWN	  if (buffer + buflen == old_buffer)	    buflen = 2 * buflen - 1024;#elif _STACK_GROWS_UP	  if (old_buffer + buflen - 1024 == buffer)	    {	      buffer = old_buffer;	      buflen = 2 * buflen - 1024;	    }#endif	}    }  if (secure[hstdb])    seteuid (oldeuid);  cache_addhst (db, fd, req, key, hst, uid);  if (use_malloc)    free (buffer);}