'\"macro stdmacro
.if n .pH g2.uname @(#)uname	40.16 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} uname 2 "" "\&"
.if \nX=1 .ds x} uname 2 ""
.if \nX=2 .ds x} uname 2 "" "\&"
.if \nX=3 .ds x} uname "" "" "\&"
.TH \*(x}
.SH NAME
\f4uname\f1 \- get name of current UNIX system
.SH SYNOPSIS
\f4#include <sys/utsname.h>\f1
.PP
\f4int uname(struct utsname \(**name);\f1
.SH DESCRIPTION
\f4uname\f1
stores information identifying the current
.SM UNIX
system in the structure pointed to by
\f2name\f1.
.PP
\f4uname\f1
uses the structure \f4utsname\fP
defined in \f4<sys/utsname.h>\f1 whose members are:
.PP
.RS
.ft 4
char	sysname[SYS_NMLN];
.br
char	nodename[SYS_NMLN];
.br
char	release[SYS_NMLN];
.br
char	version[SYS_NMLN];
.br
char	machine[SYS_NMLN];
.ft 1
.RE
.PP
\f4uname\f1
returns
a null-terminated character string naming the current
.SM UNIX
system in the character array
\f2sysname\f1.
Similarly,
\f2nodename\f1
contains the name that the system is known by on a communications
network.
\f2release\f1
and
\f2version\f1
further identify the operating system.
\f2machine\f1
contains a standard name that identifies the hardware that the
.SM UNIX
system is running on.
.TP 15
\f4EFAULT\f1
\f4uname\f1
fails if
\f2name\f1
points to an invalid address.
.SH SEE ALSO
\f4uname\f1(1) in the
\f2User's Reference Manual\f1.
.SH "DIAGNOSTICS"
Upon successful completion, a non-negative value is returned.
Otherwise, a value of \-1 is returned and
\f4errno\fP
is set to indicate the error.
