mirror of https://github.com/mkerrisk/man-pages
Add notes on the different system call interfaces that
have appeared over time.
This commit is contained in:
parent
07b88ec8d4
commit
ed4510c437
35
man2/uname.2
35
man2/uname.2
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue