Changeset a645637 in rtems for testsuites/samples/fileio/init.c


Ignore:
Timestamp:
Apr 17, 2008, 10:46:15 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
8ae91559
Parents:
e31f420f
Message:

2008-04-17 Joel Sherrill <joel.sherrill@…>

  • fileio/init.c, hello/system.h, minimum/init.c, unlimited/system.h: Use CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER where needed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/samples/fileio/init.c

    re31f420f ra645637  
    100100#include <rtems/shell.h>
    101101
     102void writeScript(
     103  const char *name,
     104  const char *contents
     105)
     106{
     107  int sc;
     108  sc = setuid(0);
     109  if ( sc ) {
     110    printf( "setuid failed: %s:\n", name, strerror(errno) );
     111  }
     112
     113  rtems_shell_write_file( name, contents );
     114  sc = chmod ( name, 0777 );
     115  if ( sc ) {
     116    printf( "chmod %s: %s:\n", name, strerror(errno) );
     117  }
     118}
     119
    102120void fileio_start_shell(void)
    103121{
     122  int sc;
     123  sc = mkdir("/scripts", 0777);
     124  if ( sc ) {
     125    printf( "mkdir /scripts: %s:\n", strerror(errno) );
     126  }
     127
     128  writeScript(
     129    "/scripts/js",
     130    "#! joel\n"
     131    "\n"
     132    "date\n"
     133    "echo Script successfully ran\n"
     134    "date\n"
     135    "stackuse\n"
     136  );
     137
     138  writeScript(
     139    "/scripts/j1",
     140    "#! joel -s 20480 -t JESS\n"
     141    "stackuse\n"
     142  );
     143
     144  rtems_shell_write_file(
     145    "/scripts/j2",
     146    "echo j2 TEST FILE\n"
     147    "echo j2   SHOULD BE non-executable AND\n"
     148    "echo j2   DOES NOT have the magic first line\n"
     149  );
     150
    104151  printf(" =========================\n");
    105152  printf(" starting shell\n");
    106153  printf(" =========================\n");
    107154  rtems_shell_init("SHLL",RTEMS_MINIMUM_STACK_SIZE * 4,100,"/dev/console",
    108                    0, 0);
     155                   0, 1);
    109156  rtems_task_suspend(RTEMS_SELF);
    110157}
Note: See TracChangeset for help on using the changeset viewer.