UNAME(3) BSD Programmer's Manual UNAME(3)
NAME
uname - get system identification strings
SYNOPSIS
#include <sys/utsname.h>
int
uname(struct utsname *u)
DESCRIPTION
The uname() function provides system information strings. The utsname
structure contains a set of these strings:
struct utsname {
char nodename[];
char sysname[];
char release[];
char version[];
char machine[];
};
These fields contain the following information:
nodename The current hostname, similar to output from hostname(1).
sysname The name of the operating system.
release The current release (typically numbers separated by dots).
version The current version (typically a number).
machine The architecture identifier, similar to output from machine(1).
RETURN VALUES
The uname() function returns a nonnegative value if it succeeds in get-
ting system identifiers, otherwise it returns -1 and sets errno appropri-
ately.
ERRORS
The following error may be reported:
[EFAULT] The buffer u was not a valid address.
SEE ALSO
gethostname(2)
STANDARDS
The uname() function conforms to IEEE Std1003.1-1988 (``POSIX'').
BSDI BSD/386 March 26, 1993 1