[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    uname(2) manual page Table of Contents

Name

uname - get name of current operating system

Synopsis

#include <sys/utsname.h>

int uname(struct utsname *name);

MT-Level

Async-Signal-Safe

Description

uname() stores information identifying the current operating system in the structure pointed to by name.

uname() uses the structure utsname defined in <sys/utsname.h> whose members include:

char    sysname[SYS_NMLN];
char    nodename[SYS_NMLN];
char    release[SYS_NMLN];
char    version[SYS_NMLN];
char    machine[SYS_NMLN];

uname() returns a null-terminated character string naming the current operating system in the character array sysname. Similarly, nodename contains the name that the system is known by on a communications network. release and version further identify the operating system. machine contains a standard name that identifies the hardware that the operating system is running on.

Return Values

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

Errors

EFAULT
uname() fails if name points to an illegal address.

See Also

uname(1) , sysinfo(2) , sysconf(3C)


Table of Contents