NetBSD/lib/libc/sys/uname.2
1993-12-15 20:32:47 +00:00

102 lines
3.2 KiB
Groff

.\" Copyright (c) 1983, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" from: @(#)uname.2 6.6 (Berkeley) 3/10/91
.\" $Id: uname.2,v 1.5 1993/12/15 20:40:38 jtc Exp $
.\"
.Dd March 29, 1993
.Dt UNAME 2
.Os
.Sh NAME
.Nm uname
.Nd get host information
.Sh SYNOPSIS
.Fd #include <sys/utsname.h>
.Ft int
.Fn uname "struct utsname *name"
.Sh DESCRIPTION
.Fn Uname
returns the information identifying the current UNIX system
in the structure pointed to by
.Fa name.
.Pp
.Fn Uname
uses the structure defined in
.Aq Pa sys/utsname.h
whose members are:
.Bd -literal
struct utsname {
char sysname[SYS_NMLN];
char nodename[SYS_NMLN];
char release[SYS_NMLN];
char version[SYS_NMLN];
char machine[SYS_NMLN];
};
.Ed
.Pp
.Fn Uname
returns a null-terminated character string naming the
current UNIX system in the character array
.Fa sysname .
Similarly,
.Fa nodename
contains the name that the system is known by on a
communication network.
.Fa Release
and
.Fa version
further identify the operating system.
.Fa Machine
contains the standard name that identifies the hardware
that the UNIX system is running on.
.Sh RETURN VALUE
Upon successful completion a value of 0 is returned.
Otherwise, a value of -1 is returned and
.Va errno
is set to indicate the error.
.Sh ERRORS
.Bl -tag -width Er
.It Bq Er EFAULT
.Fn Uname
will fail if
.Fa name
points to an invalid address.
.El
.Sh SEE ALSO
.Xr hostname 1 ,
.Xr machine 1 ,
.Xr gethostname 2
.Sh HISTORY
The
.Nm uname
function call appeared in
.At V.2 .