UNAME(2,L) AIX Technical Reference UNAME(2,L)
-------------------------------------------------------------------------------
uname, unamex
PURPOSE
Gets the name of the current AIX system.
SYNTAX
#include <sys/utsname.h>
int uname (name) int unamex (name)
struct utsname *name; struct xutsname *name;
DESCRIPTION
The uname system call stores information identifying the current system in the
structure pointed to by the name parameter.
The uname system call uses the utsname structure, which is defined in the
sys/utsname.h file, and it contains the following members:
char sysname[_UTSNMLEN];
char nodename[_UTSNMLEN];
char release[_UTSNMLEN];
char version[_UTSNMLEN];
char machine[_UTSNMLEN];
The uname system call returns a null-terminated character string naming the
current system in the character array sysname. The nodename array contains the
name that the system is known by on a communications network. The release and
version arrays further identify the system.
The machine array identifies the CPU hardware being used. This array contains
a null-terminated string which currently has one of the following values:
ID Description
"i386" PS/2
"B370" System/370
"XA370" System/370 XA
The unamex system call uses the xutsname structure, which is defined in the
sys/utsname.h file, and it contains the following members:
Processed November 7, 1990 UNAME(2,L) 1
UNAME(2,L) AIX Technical Reference UNAME(2,L)
unsigned long nid;
long reserved[3];
If the Transparent Computing Facility (TCF) is installed, the xutsname.nid
field contains the TCF site number of the local machine; otherwise, the value
of xutsname.nid is unspecified.
RETURN VALUE
Upon successful completion, a nonnegative value is returned. If the uname or
unamex system call fails, a value of -1 is returned and errno is set to
indicate the error.
ERROR CONDITIONS
The uname and unamex system calls fail if:
EFAULT The name parameter points to a location outside of the process's
allocated address space.
RELATED INFORMATION
The uname command in AIX Operating System Commands Reference.
Processed November 7, 1990 UNAME(2,L) 2