summaryrefslogtreecommitdiffstats
path: root/upstream/debian-bookworm/man2/uname.2
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
commitfc22b3d6507c6745911b9dfcc68f1e665ae13dbc (patch)
treece1e3bce06471410239a6f41282e328770aa404a /upstream/debian-bookworm/man2/uname.2
parentInitial commit. (diff)
downloadmanpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.tar.xz
manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.zip
Adding upstream version 4.22.0.upstream/4.22.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/debian-bookworm/man2/uname.2')
-rw-r--r--upstream/debian-bookworm/man2/uname.2132
1 files changed, 132 insertions, 0 deletions
diff --git a/upstream/debian-bookworm/man2/uname.2 b/upstream/debian-bookworm/man2/uname.2
new file mode 100644
index 00000000..601b674f
--- /dev/null
+++ b/upstream/debian-bookworm/man2/uname.2
@@ -0,0 +1,132 @@
+.\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\" 2007-07-05 mtk: Added details on underlying system call interfaces
+.\"
+.TH uname 2 2023-02-05 "Linux man-pages 6.03"
+.SH NAME
+uname \- get name and information about current kernel
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " \-lc )
+.SH SYNOPSIS
+.nf
+.B #include <sys/utsname.h>
+.PP
+.BI "int uname(struct utsname *" buf );
+.fi
+.SH DESCRIPTION
+.BR uname ()
+returns system information in the structure pointed to by
+.IR buf .
+The
+.I utsname
+struct is defined in
+.IR <sys/utsname.h> :
+.PP
+.in +4n
+.EX
+struct utsname {
+ char sysname[]; /* Operating system name (e.g., "Linux") */
+ char nodename[]; /* Name within communications network
+ to which the node is attached, if any */
+ char release[]; /* Operating system release
+ (e.g., "2.6.28") */
+ char version[]; /* Operating system version */
+ char machine[]; /* Hardware type identifier */
+#ifdef _GNU_SOURCE
+ char domainname[]; /* NIS or YP domain name */
+#endif
+};
+.EE
+.in
+.PP
+The length of the arrays in a
+.I struct utsname
+is unspecified (see NOTES);
+the fields are terminated by a null byte (\[aq]\e0\[aq]).
+.SH RETURN VALUE
+On success, zero is returned.
+On error, \-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH ERRORS
+.TP
+.B EFAULT
+.I buf
+is not valid.
+.SH STANDARDS
+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
+The kernel has the name, release, version, and supported machine type built in.
+Conversely, the
+.I nodename
+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 is set via
+.BR setdomainname (2).
+.PP
+The length of the fields in the struct varies.
+Some operating systems
+or libraries use a hardcoded 9 or 33 or 65 or 257.
+Other systems use
+.B SYS_NMLN
+or
+.B _SYS_NMLN
+or
+.B UTSLEN
+or
+.BR _UTSNAME_LENGTH .
+Clearly, it is a bad
+idea to use any of these constants; just use sizeof(...).
+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 ,
+.IR hostname ,
+.IR osrelease ,
+.IR version ,
+.IR domainname }.
+.SS C library/kernel differences
+Over time, increases in the size of the
+.I utsname
+structure have led to three successive versions of
+.BR uname ():
+.IR sys_olduname ()
+(slot
+.IR __NR_oldolduname ),
+.IR sys_uname ()
+(slot
+.IR __NR_olduname ),
+and
+.IR sys_newuname ()
+(slot
+.IR __NR_uname) .
+The first one
+.\" That was back before Linux 1.0
+used length 9 for all fields;
+the second
+.\" That was also back before Linux 1.0
+used 65;
+the third also uses 65 but adds the
+.I domainname
+field.
+The glibc
+.BR uname ()
+wrapper function hides these details from applications,
+invoking the most recent version of the system call provided by the kernel.
+.SH SEE ALSO
+.BR uname (1),
+.BR getdomainname (2),
+.BR gethostname (2),
+.BR uts_namespaces (7)