Andrew Boyd(deleted)
08/05/2009 10:38 AM
post35272
|
> if _CS_DOMAIN set example.org and
> _CS_HOSTNAME set qnx.example.org (FQDN),
> qnet uses qnx.example.org.example.org
Right - looking at the qnet source, I'm
pretty sure that you're going to have to
setconf _CS_HOSTNAME with the hostname, and
setconf _CS_DOMAIN with the domain.
If you're being passed a FQDN then I think
you are going to have to parse it into the
separate pieces. I might suggest using
the strchr() library function call like this:
void parse_fqdn(char *fqdn)
{
char *hostname, *domain;
domain = strchr(fqdn,".");
domain[0] = 0; // overwrite dot after hostname
domain++;
hostname=fqdn;
confstr(_CS_SET | _CS_HOSTNAME, hostname);
confstr(_CS_SET | _CS_DOMAIN, domain);
}
a strdup of the fqdn would be a nice touch.
Typing this in, I feel a touch of nostalgia -
this is like an interview question, fresh
out of school :-)
P.S. (threadjack warning) I have a MUCH better
interview question!
--
aboyd
|
|
|