char release[]; /* Operating system release
(e.g., "2.6.28") */
char version[]; /* Operating system version */
- char machine[]; /* Hardware identifier */
+ char machine[]; /* Hardware type identifier */
#ifdef _GNU_SOURCE
char domainname[]; /* NIS or YP domain name */
#endif
.I buf
is not valid.
.SH CONFORMING TO
-POSIX.1-2001, POSIX.1-2008, SVr4.
-There is no
-.BR uname ()
-call in 4.3BSD.
+POSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD.
.PP
The
.I domainname
member (the NIS or YP domain name) is a GNU extension.
.SH NOTES
-This is a system call, and the operating system presumably knows
-its name, release, and version.
-It also knows what hardware it runs on.
-So, four of the fields of the struct are meaningful.
-On the other hand, the field
+The kernel has the name, release, version, and supported machine type built in.
+Conversely, the
.I nodename
-is meaningless:
-it gives the name of the present machine in some network
-to which it's attached,
-but typically machines are in more than one network
-and have several names by which they're reachable.
-Moreover, the kernel has no way of knowing
-about such things, so it has to be told what to answer here.
-The same holds for the additional
+field is configured by the administrator to match the network
+(this is what the BSD historically calls the "hostname",
+and is set via
+.BR sethostname (2)).
+Similarly, the
.I domainname
-field.
-.PP
-To this end, Linux uses the system calls
-.BR sethostname (2)
-and
+field is set via
.BR setdomainname (2).
-Note that there is no standard that says that the hostname set by
-.BR sethostname (2)
-is the same string as the
-.I nodename
-field of the struct returned by
-.BR uname ()
-(indeed, some systems allow a 256-byte hostname and an 8-byte nodename),
-but this is true on Linux.
-The same holds for
-.BR setdomainname (2)
-and the
-.I domainname
-field.
.PP
The length of the fields in the struct varies.
Some operating systems
.BR _UTSNAME_LENGTH .
Clearly, it is a bad
idea to use any of these constants; just use sizeof(...).
-Often 257 is chosen in order to have room for an internet hostname.
+SVr4 uses 257, "to support Internet hostnames"
+\(em this is the largest value likely to be encountered in the wild.
.PP
Part of the utsname information is also accessible via
.IR /proc/sys/kernel/ { ostype ,