[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

uname

Return the name of the operating system (POSIX)

Syntax:

uname [-amnprsv] [-S name]

Options:

-a
Behave as if the options -snrvmp were specified.
-m
Write the name of the hardware type on which the system is running.
-n
Write the name of this node.
-p
Write the processor name.
-r
Write the current release level of the operating system (indicated by a number).
-S name
Set the host name.
-s
Write the name of the operating system.
-v
Write the current version level of this release of the operating system (indicated by a timestamp).

Description:

The uname utility writes to standard output information on the name and release of the operating system being run. A portable application may use uname on any POSIX system to determine what operating system it's running under.

If you don't specify any options, uname writes the operating system name (QNX).

Examples:

Write the operating system name:

uname

Write a formatted string showing the name, release level, and version level of the operating system:

printf "OS: %s release %s version %s\n" $(uname -srv)

Exit status:

0
Success
> 0
An error occurred.

Caveats:

The pidin utility provides more detailed information than uname, but pidin is a QNX Neutrino utility and isn't present on other systems.

See also:

pidin

uname() in the Library Reference


[Previous] [Contents] [Index] [Next]