os/ossrv/genericopenlibs/openenvcore/include/sys/utsname.dosc
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/** @file  ../include/sys/utsname.h
sl@0
     2
@internalComponent
sl@0
     3
*/
sl@0
     4
sl@0
     5
/** @fn  uname(struct utsname *buf)
sl@0
     6
@param buf
sl@0
     7
@return   Upon successful completion, a non-negative value is returned. Otherwise, 
sl@0
     8
-1 is returned and errno is set to indicate the error.
sl@0
     9
sl@0
    10
@code
sl@0
    11
 sysname Name of the operating system implementation.
sl@0
    12
 nodename Network name of this machine.
sl@0
    13
 release Release level of the operating system.
sl@0
    14
 version Version level of the operating system.
sl@0
    15
 machine Machine hardware platform.
sl@0
    16
sl@0
    17
@endcode
sl@0
    18
  The uname function stores NULL -terminated strings of information identifying the current system 
sl@0
    19
into the structure referenced by name .
sl@0
    20
sl@0
    21
 The utsname structure is defined in the \#include \<sys/utsname.h\> header file, and contains 
sl@0
    22
  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.
sl@0
    23
sl@0
    24
Examples:
sl@0
    25
@code
sl@0
    26
#include <sys/utsname.h>
sl@0
    27
#include<stdio.h>
sl@0
    28
int test_uname()
sl@0
    29
{
sl@0
    30
    int retVal;
sl@0
    31
    struct utsname name ;
sl@0
    32
    retVal = uname( &name; );
sl@0
    33
    if( !retVal )       
sl@0
    34
    {
sl@0
    35
      printf("Sysname: %s
sl@0
    36
 Nodename:%s
sl@0
    37
 Release:
sl@0
    38
      %s
sl@0
    39
Version: %s
sl@0
    40
Machine:%s
sl@0
    41
");
sl@0
    42
      printf("uname passed");
sl@0
    43
      return 0;
sl@0
    44
    }
sl@0
    45
    else
sl@0
    46
    {
sl@0
    47
      printf("failed");
sl@0
    48
      return -1;
sl@0
    49
    }
sl@0
    50
}
sl@0
    51
sl@0
    52
@endcode
sl@0
    53
 Output
sl@0
    54
@code
sl@0
    55
Sysname: Symbian
sl@0
    56
Nodename: localhost
sl@0
    57
Release:
sl@0
    58
Version: 2:0:1055
sl@0
    59
Machine:
sl@0
    60
uname passed
sl@0
    61
sl@0
    62
@endcode
sl@0
    63
 
sl@0
    64
sl@0
    65
@publishedAll
sl@0
    66
@externallyDefinedApi
sl@0
    67
*/
sl@0
    68
sl@0
    69
/** @struct utsname
sl@0
    70
sl@0
    71
Contains the following members,
sl@0
    72
sl@0
    73
@publishedAll
sl@0
    74
@externallyDefinedApi
sl@0
    75
*/
sl@0
    76
sl@0
    77
/** @var utsname::sysname
sl@0
    78
Name of this OS.
sl@0
    79
*/
sl@0
    80
sl@0
    81
/** @var utsname::nodename
sl@0
    82
Name of this network node.
sl@0
    83
*/
sl@0
    84
sl@0
    85
/** @var utsname::release
sl@0
    86
Release level.
sl@0
    87
*/
sl@0
    88
sl@0
    89
/** @var utsname::version
sl@0
    90
Version level.
sl@0
    91
*/
sl@0
    92
sl@0
    93
/** @var utsname::machine
sl@0
    94
Hardware type.
sl@0
    95
*/
sl@0
    96