syscons util remove use kbdcontrol & vidcontrol instead
[unix-history] / lib / libc / sys / uname.2
CommitLineData
49124039
JH
1.\" Copyright (c) 1983, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" from: @(#)uname.2 6.6 (Berkeley) 3/10/91
326e0c26 33.\" $Id: uname.2,v 1.1 1993/10/08 01:06:55 jkh Exp $
49124039
JH
34.\"
35.Dd March 29, 1993
36.Dt UNAME 2
37.Os Posix
38.Sh NAME
39.Nm uname
40.Nd get host information
41.Sh SYNOPSIS
42.Fd #include <sys/utsname.h>
43.Ft int
44.Fn uname "struct utsname *name"
45.Sh DESCRIPTION
326e0c26
GW
46The
47.Fn uname
48function
49returns the information identifying the current operating system
49124039
JH
50in the structure pointed to by
51.Fa name.
52.Pp
53.Fn Uname
54uses the structure defined in
55.Aq Pa sys/utsname.h
56whose members are:
57.Bd -literal
58struct utsname {
59 char sysname[SYS_NMLN];
60 char nodename[SYS_NMLN];
61 char release[SYS_NMLN];
62 char version[SYS_NMLN];
63 char machine[SYS_NMLN];
64};
65.Ed
66.Pp
326e0c26
GW
67The
68.Fn uname
69function
49124039 70returns a null-terminated character string naming the
326e0c26 71current operating system in the character array
49124039
JH
72.Fa sysname .
73Similarly,
74.Fa nodename
75contains the name that the system is known by on a
76communication network.
326e0c26
GW
77The
78.Fa release
49124039
JH
79and
80.Fa version
326e0c26 81fields
49124039 82further identify the operating system.
326e0c26
GW
83The
84.Fa machine
85field
49124039 86contains the standard name that identifies the hardware
326e0c26 87that the operating system is running on.
49124039
JH
88.Sn ERRORS
89.Bl -tag -width ENAMETOOLONGAA
90.It Bq Er EFAULT
326e0c26
GW
91The
92.Fn uname
93function
49124039
JH
94will fail if
95.Fa name
96points to an invalid address.
97.Sh RETURN VALUE
98Upon successful completion a value of 0 is returned.
99Otherwise, a value of -1 is returned and
100.Va errno
101is set to indicate the error.
102.Sh SEE ALSO
103.Xr hostname 1 ,
104.Xr machine 1 ,
105.Xr gethostname 2
106.Sh HISTORY
107The
108.Nm uname
109function call appeared in
326e0c26 110.At V.2 .