UNAME(2V)

NAME
uname - get information about current system

SYNOPSIS

#include <sys/utsname.h>

int uname (name)
struct utsname *name;

DESCRIPTION

uname() stores information identifying the current operating system in the structure pointed to by name.

uname() uses the structure defined in <sys/utsname.h>, the members of which are:

    struct utsname {
        char	sysname[9];
        char	nodename[9];
        char	nodeext[65-9];
        char	release[9];
        char	version[9];
        char	machine[9];
    }

uname() places a null-terminated character string naming the current operating system in the character array sysname; this string is “SunOS” on Sun systems. nodename is set to the name that the system is known by on a communications network; this is the same value as is returned by gethostname(2). release and version are set to values that further identify the operating system. machine is set to a standard name that identifies the hardware on which the SunOS system is running. This is the same as the value displayed by arch(1).

RETURN VALUES

uname() returns:

0   on success.

-1  on failure.

SEE ALSO
arch(1), uname(1), gethostname(2)

NOTES

nodeext is provided for backwards compatability with previous SunOS Releases and provides space for node names longer than eight bytes. Applications should not use nodeext. To be maximally portable, applications that want to copy the node name to another string should use strlen(nodename) rather than the constant 9 or sizeof(nodename) as the size of the target string.

System administrators should note that systems with node names longer than eight bytes do not conform to IEEE Std 1003.1-1988, System V Interface Definition (Issue 2), or X/Open Portability Guide (Issue 2) requirements.