[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] new modules: getdomainname and xgetdomainname
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] new modules: getdomainname and xgetdomainname |
Date: |
Wed, 24 Sep 2003 13:28:36 +0200 |
User-agent: |
KMail/1.5 |
Simon Josefsson wrote:
> +/* Put up to LEN chars of the domain name into NAME.
> + Null terminate it if the name is shorter than LEN.
> + Return 0 if ok, -1 if error. */
> +extern int getdomainname(char *name, size_t len);
This is insufficient documentation. There are three notions of "domain name",
each serving a different purpose:
- The NIS (new word for YP) domain name. This used by tools for
administration of NIS, NIS+. Applications shouldn't call this
directly; instead they should use the usual <pwd.h>, <grp.h> API
for this stuff.
- The difference between the fully qualified host name and the
short host name. What is this useful for?
- The difference between the HOST part of email addresses address@hidden
and the short host name of the machine. This is not generally
useful, because nowadays many email addresses don't carry the
machine's name in them. (My machine's name is neither 'clisp' nor
'ilog'.)
getdomainname(). according to the glibc sources, is the NIS domain
name.
Btw, the Linux /bin/hostname program (not the coreutils one) returns
the first one via "hostname -y" and the second one via "hostname -d".
The email address of a user can be determined through the "user-email"
program which is part of GNU gettext.
> What do you think? I noticed that I had been using getdomainname()
> for a while
What have you been using it for? Are you maintaining the 'ypcat' program?
Bruno