Add notes on the different system call interfaces that

have appeared over time.
This commit is contained in:
Michael Kerrisk 2007-06-27 05:49:07 +00:00
parent 07b88ec8d4
commit ed4510c437
1 changed files with 28 additions and 7 deletions

View File

@ -20,7 +20,9 @@
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.TH UNAME 2 2001-12-15 "Linux" "Linux Programmer's Manual"
.\" 2007-07-05 mtk: Added details on underlying system call interfaces
.\"
.TH UNAME 2 2007-07-05 "Linux" "Linux Programmer's Manual"
.SH NAME
uname \- get name and information about current kernel
.SH SYNOPSIS
@ -109,12 +111,6 @@ 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.
.LP
There have been three Linux system calls
.BR uname ().
The first one
used length 9, the second one used 65, the third one also uses 65 but
adds the \fIdomainname\fP field.
.LP
Part of the utsname information is also accessible via
.BR sysctl (2)
and via
@ -123,6 +119,31 @@ and via
.IR osrelease ,
.IR version ,
.IR domainname }.
.SS Underlying kernel interface
.LP
Over time, increases in the size of the
.I utsuname
structure have led to three successive implementations 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 used length 9 for all fields;
the second used 65;
the third also uses 65 but adds the \fIdomainname\fP field.
The glibc
.BR uname ()
wrapper function hides these details from applications,
ensuring that new binaries use the current implementation,
and that binary compatibility is not broken
for older binaries.
.SH "SEE ALSO"
.BR uname (1),
.BR getdomainname (2),