[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uname -n output from where?
> Where does `uname -n` pull its info from? I had thought it was
> from /etc/myname, but as seen:
>
> root@Molodetz# uname -n
> Molodetz
> root@Molodetz# cat /etc/myname
> molodetz
>
> The case is different. What gives?
I took a look at the code, and it seems to come from a struct utsname as
defined sys/utsname.h (see man 3 uname as well). I think this struct is
defined at boot time from, amongst others, sysctl kern.hostname
A sysctl kern.hostname shows the machine name as well. Perhaps the
initialization does a conversion to lowercase?
// nick