Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

hostname(1)

uname(1)

gethostname(2)

sethostname(2)

privilege(5)

uname(2)

NAME

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

SYNOPSIS

#include <sys/utsname.h>

int uname(struct utsname *name);

int setuname(const char *name, size_t 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 8.0 or 8.0.1.  The version field contains additional information about the operating system.  The first character of the version field is set to:

Character Series 700/800 Series 300/400
A two-user system two-user system
B 16-user system unlimited-users system
C 32-user system
D 64-user system
E 8-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 HP-UX 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 at system boot time.  Names are limited to UTSLEN - 1 characters; UTSLEN is defined in <sys/utsname.h>. 

ERRORS

[EPERM] setuname() was attempted by a user lacking the appropriate privileges. 

[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 and HP. 

SEE ALSO

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

STANDARDS CONFORMANCE

uname(): AES, SVID2, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

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