5
Last change
on this file since 1c6926c1 was
c499856,
checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47
|
Change all references of rtems.com to rtems.org.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Get System Name |
---|
5 | * @ingroup utsname Service |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <stdio.h> |
---|
22 | #include <string.h> |
---|
23 | #include <sys/utsname.h> |
---|
24 | #include <inttypes.h> |
---|
25 | |
---|
26 | #include <rtems/score/objectimpl.h> |
---|
27 | #include <rtems/seterr.h> |
---|
28 | |
---|
29 | /* |
---|
30 | * 4.4.1 Get System Name, P1003.1b-1993, p. 90 |
---|
31 | */ |
---|
32 | |
---|
33 | int uname( |
---|
34 | struct utsname *name |
---|
35 | ) |
---|
36 | { |
---|
37 | /* XXX: Here is what Solaris returns... |
---|
38 | sysname = SunOS |
---|
39 | nodename = node_name |
---|
40 | release = 5.3 |
---|
41 | version = Generic_101318-12 |
---|
42 | machine = sun4m |
---|
43 | */ |
---|
44 | |
---|
45 | if ( !name ) |
---|
46 | rtems_set_errno_and_return_minus_one( EFAULT ); |
---|
47 | |
---|
48 | strncpy( name->sysname, "RTEMS", sizeof(name->sysname) ); |
---|
49 | |
---|
50 | snprintf( name->nodename, sizeof(name->nodename), "Node %" PRId16, _Objects_Local_node ); |
---|
51 | |
---|
52 | strncpy( name->release, RTEMS_VERSION, sizeof(name->release) ); |
---|
53 | |
---|
54 | strncpy( name->version, "", sizeof(name->version) ); |
---|
55 | |
---|
56 | snprintf( name->machine, sizeof(name->machine), "%s/%s", CPU_NAME, CPU_MODEL_NAME ); |
---|
57 | |
---|
58 | return 0; |
---|
59 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.