source: rtems/testsuites/psxtests/psx14/init.c @ fdaa86b6

4.104.11
Last change on this file since fdaa86b6 was fdaa86b6, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 30, 2009 at 5:56:15 AM

2009-10-30 Ralf Corsépius <ralf.corsepius@…>

  • psx14/init.c: Add local prototypes for rtems_object_api_minimum_class, rtems_object_api_maximum_class. Reflect the prototypes having been missing to printf's.
  • Property mode set to 100644
File size: 2.1 KB
Line 
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/* HACK: API visibility violation */
18extern uint32_t rtems_object_api_minimum_class(uint32_t api);
19extern unsigned int rtems_object_api_maximum_class(uint32_t api);
20
21void *POSIX_Init(
22  void *argument
23)
24{
25  char               name[128];
26  char              *ptr;
27  rtems_status_code  status;
28
29  puts( "\n\n*** POSIX TEST 14 ***" );
30
31  ptr = rtems_object_get_name( pthread_self(), 128, name );
32  printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
33
34  /* Set my name to Justin */
35  puts( "Setting current thread name to Justin" );
36  status = rtems_object_set_name( pthread_self(), "Justin" );
37  directive_failed( status, "rtems_object_set_name" );
38 
39  ptr = rtems_object_get_name( pthread_self(), 128, name );
40  printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
41
42  /* Set my name to Jordan */
43  puts( "Setting current thread name to Jordan" );
44  status = rtems_object_set_name( pthread_self(), "Jordan" );
45  directive_failed( status, "rtems_object_set_name" );
46 
47  ptr = rtems_object_get_name( pthread_self(), 128, name );
48  printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
49
50  /* exercise the POSIX path through some routines */
51  printf( "rtems_object_api_minimum_class(OBJECTS_POSIX_API) returned %" PRId32 "\n",
52          rtems_object_api_minimum_class(OBJECTS_POSIX_API) );
53  printf( "rtems_object_api_maximum_class(OBJECTS_POSIX_API) returned %d\n",
54          rtems_object_api_maximum_class(OBJECTS_POSIX_API) );
55
56  printf( "rtems_object_get_api_name(POSIX_API) = %s\n",
57     rtems_object_get_api_name(OBJECTS_POSIX_API) );
58
59  printf("rtems_object_get_api_class_name(POSIX_API, POSIX_KEYS) = %s\n", 
60    rtems_object_get_api_class_name( OBJECTS_POSIX_API, OBJECTS_POSIX_KEYS)
61  );
62
63
64  puts( "*** END OF POSIX TEST 14 ***" );
65  rtems_test_exit( 0 );
66
67  return NULL;
68
69}
Note: See TracBrowser for help on using the repository browser.