Re: Problem in manpage of uname(2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

On Tue, Apr 28, 2009 at 11:21 PM, Christoph Bartoschek
<bartoschek@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> I am using opensuse 11.1 with the most recent updates. The problem can also be
> found on the page
> http://www.kernel.org/doc/man-pages/online/pages/man2/uname.2.html
>
> The page states that the member domainname of struct utsname is only available
> if _GNU_SOURCE is defined.
>
> However in /usr/include/sys/utsname.h I can only find:
>
> #if _UTSNAME_DOMAIN_LENGTH - 0
>    /* Name of the domain of this node on the network.  */
> # ifdef __USE_GNU
>    char domainname[_UTSNAME_DOMAIN_LENGTH];
> # else
>    char __domainname[_UTSNAME_DOMAIN_LENGTH];
> # endif
>
> and in /usr/include/bits/utsname.h:
>
> /* Length of the entries in `struct utsname' is 65.  */
> #define _UTSNAME_LENGTH 65
>
> /* Linux provides as additional information in the `struct utsname'
>   the name of the current domain.  Define _UTSNAME_DOMAIN_LENGTH
>   to a value != 0 to activate this entry.  */
> #define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
>
>
>
> This means that for linux the struct utname has always six members and the
> last one is either named domainname or __domainname.

All of what you say above is correct, but:

> The manpage should state
> this to make clear that a struct utsname has to be initialized like this:
>
> struct utsname name = {"", "", "", "", "", ""};

Since we only get a utsname structure back from the kernel, I'm not
sure why we would need to care about initializing it as shown here.
Can you say some more please.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux