1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2008. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #define CONFIGURE_INIT |
---|
13 | #include "system.h" |
---|
14 | #include <rtems.h> |
---|
15 | #include "tmacros.h" |
---|
16 | |
---|
17 | void *POSIX_Init( |
---|
18 | void *argument |
---|
19 | ) |
---|
20 | { |
---|
21 | char name[128]; |
---|
22 | char *ptr; |
---|
23 | rtems_status_code status; |
---|
24 | |
---|
25 | puts( "\n\n*** POSIX TEST 14 ***" ); |
---|
26 | |
---|
27 | ptr = rtems_object_get_name( pthread_self(), 128, name ); |
---|
28 | printf( "rtems_object_get_name returned (%s) for init thread\n", ptr ); |
---|
29 | |
---|
30 | /* Set my name to Justin */ |
---|
31 | puts( "Setting current thread name to Justin" ); |
---|
32 | status = rtems_object_set_name( pthread_self(), "Justin" ); |
---|
33 | directive_failed( status, "rtems_object_set_name" ); |
---|
34 | |
---|
35 | ptr = rtems_object_get_name( pthread_self(), 128, name ); |
---|
36 | printf( "rtems_object_get_name returned (%s) for init thread\n", ptr ); |
---|
37 | |
---|
38 | /* Set my name to Jordan */ |
---|
39 | puts( "Setting current thread name to Jordan" ); |
---|
40 | status = rtems_object_set_name( pthread_self(), "Jordan" ); |
---|
41 | directive_failed( status, "rtems_object_set_name" ); |
---|
42 | |
---|
43 | ptr = rtems_object_get_name( pthread_self(), 128, name ); |
---|
44 | printf( "rtems_object_get_name returned (%s) for init thread\n", ptr ); |
---|
45 | |
---|
46 | /* exercise the POSIX path through some routines */ |
---|
47 | printf( "rtems_object_api_minimum_class(OBJECTS_POSIX_API) returned %d\n", |
---|
48 | rtems_object_api_minimum_class(OBJECTS_POSIX_API) ); |
---|
49 | printf( "rtems_object_api_maximum_class(OBJECTS_POSIX_API) returned %d\n", |
---|
50 | rtems_object_api_maximum_class(OBJECTS_POSIX_API) ); |
---|
51 | |
---|
52 | printf( "rtems_object_get_api_name(POSIX_API) = %s\n", |
---|
53 | rtems_object_get_api_name(OBJECTS_POSIX_API) ); |
---|
54 | |
---|
55 | printf("rtems_object_get_api_class_name(POSIX_API, POSIX_KEYS) = %s\n", |
---|
56 | rtems_object_get_api_class_name( OBJECTS_POSIX_API, OBJECTS_POSIX_KEYS) |
---|
57 | ); |
---|
58 | |
---|
59 | |
---|
60 | puts( "*** END OF POSIX TEST 14 ***" ); |
---|
61 | rtems_test_exit( 0 ); |
---|
62 | |
---|
63 | return NULL; |
---|
64 | |
---|
65 | } |
---|