h_errno = TRY_AGAIN;
SM_SET_H_ERRNO(TRY_AGAIN);
getcanonname(host, hbsize, trymx)	char *host;	int hbsize;	bool trymx;{	int nmaps;	int mapno;	bool found = FALSE;	bool got_tempfail = FALSE;	auto int status;	char *maptype[MAXMAPSTACK];	short mapreturn[MAXMAPACTIONS];	nmaps = switch_map_find("hosts", maptype, mapreturn);	for (mapno = 0; mapno < nmaps; mapno++)	{		int i;		if (tTd(38, 20))			dprintf("getcanonname(%s), trying %s\n",				host, maptype[mapno]);		if (strcmp("files", maptype[mapno]) == 0)		{			found = text_getcanonname(host, hbsize, &status);		}#ifdef NIS		else if (strcmp("nis", maptype[mapno]) == 0)		{			found = nis_getcanonname(host, hbsize, &status);		}#endif /* NIS */#ifdef NISPLUS		else if (strcmp("nisplus", maptype[mapno]) == 0)		{			found = nisplus_getcanonname(host, hbsize, &status);		}#endif /* NISPLUS */#if NAMED_BIND		else if (strcmp("dns", maptype[mapno]) == 0)		{			found = dns_getcanonname(host, hbsize, trymx, &status);		}#endif /* NAMED_BIND */#if NETINFO		else if (strcmp("netinfo", maptype[mapno]) == 0)		{			found = ni_getcanonname(host, hbsize, &status);		}#endif /* NETINFO */		else		{			found = FALSE;			status = EX_UNAVAILABLE;		}		/*		**  Heuristic: if $m is not set, we are running during system		**  startup.  In this case, when a name is apparently found		**  but has no dot, treat is as not found.  This avoids		**  problems if /etc/hosts has no FQDN but is listed first		**  in the service switch.		*/		if (found &&		    (macvalue('m', CurEnv) != NULL || strchr(host, '.') != NULL))			break;		/* see if we should continue */		if (status == EX_TEMPFAIL)		{			i = MA_TRYAGAIN;			got_tempfail = TRUE;		}		else if (status == EX_NOTFOUND)			i = MA_NOTFOUND;		else			i = MA_UNAVAIL;		if (bitset(1 << mapno, mapreturn[i]))			break;	}	if (found)	{		char *d;		if (tTd(38, 20))			dprintf("getcanonname(%s), found\n", host);		/*		**  If returned name is still single token, compensate		**  by tagging on $m.  This is because some sites set		**  up their DNS or NIS databases wrong.		*/		if ((d = strchr(host, '.')) == NULL || d[1] == '\0')		{			d = macvalue('m', CurEnv);			if (d != NULL &&			    hbsize > (int) (strlen(host) + strlen(d) + 1))			{				if (host[strlen(host) - 1] != '.')					(void) strlcat(host, ".", hbsize);				(void) strlcat(host, d, hbsize);			}			else				return FALSE;		}		return TRUE;	}	if (tTd(38, 20))		dprintf("getcanonname(%s), failed, status=%d\n", host, status);#if NAMED_BIND	if (got_tempfail)		h_errno = TRY_AGAIN;	else		h_errno = HOST_NOT_FOUND;#endif /* NAMED_BIND */	return FALSE;}