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[SYS_NMLN|;
char nodename[SYS_NMLN|;
char release[SYS_NMLN|;
char version[SYS_NMLN|;
char machine[SYS_NMLN|;
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 an eight-character string followed by
a terminating null character. The first two characters
identify the hardware model. The hardware model iden-
tification may be one of the following:
"10" IBM 6151
"20" IBM 6150
The remaining six characters of the machine string
specify the unique serial number of the machine. Each
digit of the serial number is in the range "'0'" to "'9'"
or "'A'" to "'F'".
The unamex system call uses the xutsname structure, which
is defined in the sys/utsname.h file, and it contains the
following members:
unsigned long nid;
long reserved[3|;
The xutsname.nid field is the binary form of the
utsname.machine field. For local area networks in which
a binary node name is appropriate, xutsname.nid contains
such a name.
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.
Diagnostics
The uname and unamex system calls fail if:
EFAULT The name parameter &pointsout..
Related Information
The uname command in AIX Operating System Commands Refer-
ence.