@(#) uname.2 $Date: 2011/10/14 10:38:07 $Revision: r11.31/2
uname(2)uname(2)PATCH_11.31 (B11.31.1203LR)NAMEuname(), setuname() - get information about computer system; set node
name (system name)
SYNOPSISDESCRIPTIONuname()
The system call places information identifying the computer system in
the structure pointed to by name.
The structure, defined in is set up as follows:
Each field is a null-terminated string.
The field contains the name of the operating system, on standard HP-UX
systems.
The field contains the name by which the computer system is known in a
communications network.
The field contains the release identifier of the operating system, such
as
The field contains additional information about the operating system.
This value can change in future releases. The first character of the
field identifies the license level:
Two-user system
16-user system
32-user system
64-user system
8-user system
128-user, 256-user, or unlimited-user system
The field contains the hardware and model identifiers of the computer
system. On this field always returns
The 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 sys‐
tems this number may not be unique. To get a unique id, use the option
of
setuname()
The system call sets the node name (system name), as returned in the
field of the structure, to name, which has a length of namelen charac‐
ters. This is usually executed by at system boot time. Names are lim‐
ited to 1 characters; is defined in
Security Restrictions
Prior to ContainmentExt B.11.31.03, the actions associated with this
system call require the privilege If ContainmentExt B.11.31.03 or a
later version of HP-UX Containment product is installed on the system,
either the privilege or the privilege 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 sys‐
tems that support fine-grained privileges.
RETURN VALUE
and return the following values:
Successful completion.
n is a nonnegative value.
Failure.
is set to indicate the error.
The function may return truncated results when the non-expanded version
of the structure is used. See
ERRORS
If or fails, is set to one of the following values.
name points to an illegal address. The reliable detection
of this error is implementation dependent.
was attempted by a process lacking
appropriate privileges.
This error may be detected and indicates that the
structure version used does not accommodate the full
values of one or more fields.
WARNINGS
returns one of two versions of the structure:
· HP-UX compatible version (compatible with all HP-UX versions)
· Expanded version of the structure which can accommodate
larger values.
The compatible structure is used by default. To use the expanded
structure, see nodehostnamesize(5).
If the administrator has configured a node name with a length larger
than 8 bytes, the compatible version of the structure, as returned by
contains just the first 8 bytes (plus null) in the field. In a future
release the field will not contain any data bytes if the entire node
name cannot fit.
Setting a node name of more than 8 bytes with is only possible with the
appropriate configuration options enabled. It is strongly recommended
that all related documentation be completely understood before setting
a larger node name. A node name larger than 8 bytes can cause anoma‐
lous behavior or failure in applications which use the command or the
system function to access the name.
It is recommended that, whenever possible, programs use the host name
as returned by the function rather than the field. It can be given a
sufficiently large buffer to avoid truncation issues. See gethost‐
name(2) for more information.
AUTHOR
was developed by AT&T and HP.
SEE ALSOhostname(1), uname(1), setuname(1M), gethostname(2), sethostname(2),
nodehostnamesize(5), privileges(5).
STANDARDS CONFORMANCEuname(2)