uname.2 (2011 09)

u
uname(2) uname(2)
NAME
uname(), setuname() - get information about computer system; set node name (system name)
SYNOPSIS
#include <sys/utsname.h>
int uname(struct utsname *name);
int setuname(const char *name, size_t namelen);
DESCRIPTION
uname()
The uname() system call places information identifying the computer system in the
utsname structure
pointed to by name.
The
utsname structure, defined in <sys/utsname.h>
, is set up as follows:
char sysname[];
char nodename[];
char release[];
char version[];
char machine[];
char idnumber[];
Each field is a null-terminated string.
The
sysname field contains the name of the operating system, HP-UX on standard HP-UX systems.
The
nodename field contains the name by which the computer system is known in a communications
network.
The
release field contains the release identifier of the operating system, such as B.11.23
.
The
version field contains additional information about the operating system. This value can change
in future releases. The first character of the version field identifies the license level:
A Two-user system
B 16-user system
C 32-user system
D 64-user system
E 8-user system
U 128-user, 256-user, or unlimited-user system
The
machine field contains the hardware and model identifiers of the computer system. On Itanium-
based systems, this field always returns
ia64.
The
idnumber field contains a unique identification number within that class of hardware, possibly a
hardware or software serial number. This field contains a null string if there is no identification number.
On Itanium-based systems this number may not be unique. To get a unique id, use the
_CS_MACHINE_IDENT option of confstr.
setuname()
The
setuname() system call sets the node name (system name), as returned in the nodename field of
the utsname structure, to name, which has a length of namelen characters. This is usually executed by
/sbin/init.d/hostname at system boot time. Names are limited to UTSLEN - 1 characters;
UTSLEN is defined in <sys/utsname.h>.
Security Restrictions
Prior to ContainmentExt B.11.31.03, the actions associated with this system call require the
PRIV_SYSATTR privilege (SYSATTR). If ContainmentExt B.11.31.03 or a later version of HP-UX Con-
tainment product is installed on the system, either the PRIV_SYSATTR privilege (SYSATTR) or the
PRIV_HOSTATTR privilege (HOSTATTR) is required. Processes owned by the superuser have this
privilege. Processes owned by other users may have this privilege, depending on system configuration.
See privileges (5) for more information about privileged access on systems that support fine-grained
privileges.
HP-UX 11i Version 3: September 2011 1 Hewlett-Packard Company 1

Summary of content (2 pages)