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

4.115
Last change on this file since c499856 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: 2.0 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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#define CONFIGURE_INIT
15#include "system.h"
16#include <rtems.h>
17#include <rtems/score/objectimpl.h>
18#include "tmacros.h"
19
20void *POSIX_Init(
21  void *argument
22)
23{
24  char               name[128];
25  char              *ptr;
26  rtems_status_code  status;
27
28  puts( "\n\n*** POSIX TEST 14 ***" );
29
30  ptr = rtems_object_get_name( pthread_self(), 128, name );
31  printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
32
33  /* Set my name to Justin */
34  puts( "Setting current thread name to Justin" );
35  status = rtems_object_set_name( pthread_self(), "Justin" );
36  directive_failed( status, "rtems_object_set_name" );
37
38  ptr = rtems_object_get_name( pthread_self(), 128, name );
39  printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
40
41  /* Set my name to Jordan */
42  puts( "Setting current thread name to Jordan" );
43  status = rtems_object_set_name( pthread_self(), "Jordan" );
44  directive_failed( status, "rtems_object_set_name" );
45
46  ptr = rtems_object_get_name( pthread_self(), 128, name );
47  printf( "rtems_object_get_name returned (%s) for init thread\n", ptr );
48
49  /* exercise the POSIX path through some routines */
50  printf( "rtems_object_api_minimum_class(OBJECTS_POSIX_API) returned %d\n",
51          rtems_object_api_minimum_class(OBJECTS_POSIX_API) );
52  printf( "rtems_object_api_maximum_class(OBJECTS_POSIX_API) returned %d\n",
53          rtems_object_api_maximum_class(OBJECTS_POSIX_API) );
54
55  printf( "rtems_object_get_api_name(POSIX_API) = %s\n",
56     rtems_object_get_api_name(OBJECTS_POSIX_API) );
57
58  printf("rtems_object_get_api_class_name(POSIX_API, POSIX_KEYS) = %s\n",
59    rtems_object_get_api_class_name( OBJECTS_POSIX_API, OBJECTS_POSIX_KEYS)
60  );
61
62
63  puts( "*** END OF POSIX TEST 14 ***" );
64  rtems_test_exit( 0 );
65
66  return NULL;
67
68}
Note: See TracBrowser for help on using the repository browser.