[Gambas-user] System.Domain empty
Benoit Minisini
gambas at ...1...
Fri May 16 11:12:09 CEST 2008
On vendredi 16 mai 2008, Ron wrote:
> Benoit Minisini schreef:
> > On jeudi 15 mai 2008, Ron wrote:
> >> System.Domain is empty (none) on my system (Debian 4.0) gambas 2.6
> >>
> >> hostname -f is giving correct fqdn
> >>
> >> Where should it be defined?
> >>
> >> Regards,
> >> Ron.
> >
> > The Linux man page are not very clear...
> >
> > Apparently, you have:
> > - A system host name.
> > - A system domain name, or DNS domain name.
> > - A NIS/YP domain name.
> >
> > hostname -f returns the third, but System.Domain uses the getdomainname()
> > system call that seems to return the second.
> >
> > Try "man hostname" to get more information.
> >
> > Regards,
>
> This is what I see.. so it looks like gambas is reading the NIS domain
> instead of the correct one (-d).
There is no "correct one". Gambas just uses the getdomainname() function that
uses the uname() system call, and this system call returns what it returns.
But you are right: I traced the "hostname" program with strace. When asking
for the host name or the NIS/YP domain name, it uses the uname() system call.
So if you want to get the FQDN, you have to run "hostname -f" by hand.
Apparently there is no function in the C library to get this information, as
it requires some heavy process.
Regards,
--
Benoit Minisini
More information about the User
mailing list