Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Apropos / Subsearch:
optional field

UNAME(2V)                                                            UNAME(2V)

       uname - get information about current system

       #include <&lt;sys/utsname.h>&gt;

       int uname (name)
       struct utsname *name;

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

       uname() uses the structure defined in <&lt;sys/utsname.h>&gt;, the  members  of
       which are:

              struct utsname {
                     char sysname[9];
                     char nodename[9];
                     char nodeext[65-9];
                     char release[9];
                     char version[9];
                     char machine[9];

       uname()  places  a  null-terminated character string naming the current
       operating system in the character array sysname; this string is "SunOS"
       on  Sun  systems.  nodename is set to the name that the system is known
       by on a communications network; this is the same value as  is  returned
       by  gethostname(2).  release and version are set to values that further
       identify the operating system.  machine is set to a standard name  that
       identifies  the hardware on which the SunOS system is running.  This is
       the same as the value displayed by arch(1).

       uname() returns:

       0      on success.

       -1     on failure.

       arch(1), uname(1), gethostname(2)

       nodeext is provided for backwards  compatability  with  previous  SunOS
       Releases  and  provides  space  for node names longer than eight bytes.
       Applications should not use nodeext.  To be maximally portable,  appli-
       cations  that  want  to copy the node name to another string should use
       strlen(nodename) rather than the constant 9 or sizeof(nodename) as  the
       size of the target string.

       System  administrators  should note that systems with node names longer
       than eight bytes do not conform  to  IEEE  Std  1003.1-1988,  System  V
       Interface  Definition  (Issue 2), or X/Open Portability Guide (Issue 2)

                                21 January 1990                      UNAME(2V)