Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ uname(2) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

hostname(1)

uname(1)

gethostname(2)

sethostname(2)

UNAME(2)

NAME

uname, setuname − get/set name of current HP-UX system

SYNOPSIS

#include <sys/utsname.h>

int uname (name)
struct utsname ∗name;

int setuname(name, namelen)
char *name;
int namelen;

DESCRIPTION

Uname stores information identifying the current HP-UX system in the structure pointed to by name.

Uname uses the structure defined in <sys/utsname.h> whose members are:

#define UTSLEN 9
#define SNLEN 15


char sysname[UTSLEN];
char nodename[UTSLEN];
char release[UTSLEN];
char version[UTSLEN];
char machine[UTSLEN];
char idnumber[SNLEN];

Uname returns a null-terminated string in each field.  The sysname field contains "HP-UX".  Similarly, the nodename field contains the name by which the system is known on a communications network.  The release field contains the release number of the operating system, such as "1.0" or "3.0.1".  The version field contains additional information about the operating system.  The first character of the version field is set to:

Character Series 800 Series 300
A single user system two-user system
B 16-user system unlimited-users system
C 32-user system
D 64-user system
U unlimited-users system

(Note that the contents of the version field might change on future releases, as AT&T license agreement restrictions change.)  The machine field contains a standard name that identifies the hardware on which the UNIX system is running.  The idnumber is a unique identification number within that class of hardware, possibly a hardware or software serial number.  This field returns the null string to indicate the lack of an identification number. 

Setuname sets the nodename field in the utsname structure to name, which has a length of namelen characters.  This is usually executed by /etc/rc when the system is bootstrapped.  Names are limited to UTSLEN - 1 characters; UTSLEN is defined in <sys/utsname.h>. 

ERRORS

­[EPERM] Setuname is not executed by the superuser. 

­[EFAULT] Name points to an illegal address.  The reliable detection of this error is implementation dependent. 

RETURN VALUE

Upon successful completion, a non-negative value is returned.  Otherwise, −1 is returned and errno is set to indicate the error. 

AUTHOR

Uname was developed by AT&T Bell Laboratories and the Hewlett-Packard Company. 

SEE ALSO

hostname(1), uname(1), gethostname(2), sethostname(2).

STANDARDS CONFORMANCE

uname: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026