Name

uname - print system information

Library

libc.lib

Synopsis

  #include <sys/utsname.h>
  int uname (struct utsname *name);

Return values

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

Detailed description

The uname function stores NUL -terminated strings of information identifying the current system into the structure referenced by name.

The utsname structure is defined in the

  #include <sys/utsname.h>header file, and contains the following members:
sysname Name of the operating system implementation.
nodename Network name of this machine.
release Release level of the operating system.
version Version level of the operating system.
machine Machine hardware platform.


Examples

#include <sys/utsname.h>
#include<stdio.h>
int test_uname()
{
    int retVal;
    struct utsname name ;
    retVal = uname( &name );
    if( !retVal )       
    {
      printf("Sysname: %s\n Nodename:%s\n Release:
      %s\nVersion: %s\nMachine:%s\n");
      printf("uname passed");
      return 0;
    }
    else
    {
      printf("failed");
      return -1;
    }
}

         

Output

Sysname: Symbian
Nodename: localhost
Release:
Version: 2:0:1055
Machine:
uname passed

         

Errors

No errors defined.


Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top