Changeset 714f06c in rtems


Ignore:
Timestamp:
Apr 17, 2004, 8:12:02 AM (17 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
8b96149
Parents:
0fdc099
Message:

2004-04-17 Ralf Corsepius <ralf_corsepius@…>

  • libmisc/capture/capture-cli.c, libmisc/cpuuse/cpuuse.c, libmisc/dumpbuf/dumpbuf.c, libmisc/fsmount/fsmount.c, libmisc/monitor/mon-command.c, libmisc/monitor/mon-config.c, libmisc/monitor/mon-dname.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-extension.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-mpci.c, libmisc/monitor/mon-object.c, libmisc/monitor/mon-prmisc.c, libmisc/monitor/mon-queue.c, libmisc/monitor/mon-symbols.c, libmisc/monitor/mon-task.c, libmisc/rtmonuse/rtmonuse.c, libmisc/shell/cmds.c, libmisc/shell/shell.c, libmisc/shell/shell.h, libmisc/stackchk/check.c, libmisc/untar/untar.c: Use fprintf(stdout,...) instead of printf.
Location:
cpukit
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r0fdc099 r714f06c  
     12004-04-17      Ralf Corsepius <ralf_corsepius@rtems.org>
     2
     3        * libmisc/capture/capture-cli.c, libmisc/cpuuse/cpuuse.c,
     4        libmisc/dumpbuf/dumpbuf.c, libmisc/fsmount/fsmount.c,
     5        libmisc/monitor/mon-command.c, libmisc/monitor/mon-config.c,
     6        libmisc/monitor/mon-dname.c, libmisc/monitor/mon-driver.c,
     7        libmisc/monitor/mon-extension.c, libmisc/monitor/mon-itask.c,
     8        libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-mpci.c,
     9        libmisc/monitor/mon-object.c, libmisc/monitor/mon-prmisc.c,
     10        libmisc/monitor/mon-queue.c, libmisc/monitor/mon-symbols.c,
     11        libmisc/monitor/mon-task.c, libmisc/rtmonuse/rtmonuse.c,
     12        libmisc/shell/cmds.c, libmisc/shell/shell.c, libmisc/shell/shell.h,
     13        libmisc/stackchk/check.c, libmisc/untar/untar.c: Use
     14        fprintf(stdout,...) instead of printf.
     15
    1162004-04-14      Ralf Corsepius <ralf_corsepius@rtems.org>
    217
  • cpukit/libmisc/capture/capture-cli.c

    r0fdc099 r714f06c  
    7676  if (argc <= 1)
    7777  {
    78     printf (open_usage);
     78    fprintf(stdout,open_usage);
    7979    return;
    8080  }
     
    8787        enable = 1;
    8888      else
    89         printf ("warning: option -%c ignored\n", argv[arg][1]);
     89        fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    9090    }
    9191    else
     
    9595      if (size < 100)
    9696      {
    97         printf ("error: size must be greater than or equal to 100\n");
     97        fprintf(stdout,"error: size must be greater than or equal to 100\n");
    9898        return;
    9999      }
     
    105105  if (sc != RTEMS_SUCCESSFUL)
    106106  {
    107     printf ("error: open failed: %s\n", rtems_status_text (sc));
    108     return;
    109   }
    110 
    111   printf ("capture engine opened.\n");
     107    fprintf(stdout,"error: open failed: %s\n", rtems_status_text (sc));
     108    return;
     109  }
     110
     111  fprintf(stdout,"capture engine opened.\n");
    112112
    113113  if (!enable)
     
    118118  if (sc != RTEMS_SUCCESSFUL)
    119119  {
    120     printf ("error: open enable failed: %s\n", rtems_status_text (sc));
    121     return;
    122   }
    123 
    124   printf ("capture engine enabled.\n");
     120    fprintf(stdout,"error: open enable failed: %s\n", rtems_status_text (sc));
     121    return;
     122  }
     123
     124  fprintf(stdout,"capture engine enabled.\n");
    125125}
    126126
     
    147147  if (sc != RTEMS_SUCCESSFUL)
    148148  {
    149     printf ("error: close failed: %s\n", rtems_status_text (sc));
    150     return;
    151   }
    152 
    153   printf ("capture engine closed.\n");
     149    fprintf(stdout,"error: close failed: %s\n", rtems_status_text (sc));
     150    return;
     151  }
     152
     153  fprintf(stdout,"capture engine closed.\n");
    154154}
    155155
     
    176176  if (sc != RTEMS_SUCCESSFUL)
    177177  {
    178     printf ("error: enable failed: %s\n", rtems_status_text (sc));
    179     return;
    180   }
    181 
    182   printf ("capture engine enabled.\n");
     178    fprintf(stdout,"error: enable failed: %s\n", rtems_status_text (sc));
     179    return;
     180  }
     181
     182  fprintf(stdout,"capture engine enabled.\n");
    183183}
    184184
     
    205205  if (sc != RTEMS_SUCCESSFUL)
    206206  {
    207     printf ("error: disable failed: %s\n", rtems_status_text (sc));
    208     return;
    209   }
    210 
    211   printf ("capture engine disabled.\n");
     207    fprintf(stdout,"error: disable failed: %s\n", rtems_status_text (sc));
     208    return;
     209  }
     210
     211  fprintf(stdout,"capture engine disabled.\n");
    212212}
    213213
     
    246246  total_time = (ticks * rtems_capture_task_time (task)) + tick_offset;
    247247
    248   printf ("total %i\n", count);
     248  fprintf(stdout,"total %i\n", count);
    249249
    250250  while (task)
     
    267267    priority = rtems_capture_task_real_priority (task);
    268268
    269     printf (" ");
     269    fprintf(stdout," ");
    270270    rtems_monitor_dump_id (rtems_capture_task_id (task));
    271     printf (" ");
     271    fprintf(stdout," ");
    272272    rtems_monitor_dump_name (rtems_capture_task_name (task));
    273     printf (" ");
     273    fprintf(stdout," ");
    274274    rtems_monitor_dump_priority (rtems_capture_task_start_priority (task));
    275     printf (" ");
     275    fprintf(stdout," ");
    276276    rtems_monitor_dump_priority (rtems_capture_task_real_priority (task));
    277     printf (" ");
     277    fprintf(stdout," ");
    278278    rtems_monitor_dump_priority (rtems_capture_task_curr_priority (task));
    279     printf (" ");
     279    fprintf(stdout," ");
    280280    rtems_monitor_dump_state (rtems_capture_task_state (task));
    281     printf (" %c%c%c%c%c",
     281    fprintf(stdout," %c%c%c%c%c",
    282282            rtems_capture_task_valid (task) ? 'a' : 'd',
    283283            rtems_capture_task_flags (task) & RTEMS_CAPTURE_TRACED ? 't' : '-',
     
    286286            rtems_capture_task_control_flags (task) & RTEMS_CAPTURE_FROM_TO ? 'E' : '-');
    287287    if ((floor > ceiling) && (ceiling > priority))
    288       printf ("--");
     288      fprintf(stdout,"--");
    289289    else
    290       printf ("%c%c",
     290      fprintf(stdout,"%c%c",
    291291              rtems_capture_task_control (task) ?
    292292              (rtems_capture_task_control_flags (task) & RTEMS_CAPTURE_WATCH ? 'w' : '+') : '-',
    293293              rtems_capture_watch_global_on () ? 'g' : '-');
    294     printf (" %3i%% %3i%% (%i)\n",
     294    fprintf(stdout," %3i%% %3i%% (%i)\n",
    295295            stack_used, time_used, rtems_capture_task_ticks (task));
    296296
     
    315315  int                 last_count = 0;
    316316
    317   printf ("\x1b[2J Press ENTER to exit.\n\n");
    318   printf ("     PID NAME RPRI CPRI STATE  %%CPU     %%STK FLGS   EXEC TIME\n");
     317  fprintf(stdout,"\x1b[2J Press ENTER to exit.\n\n");
     318  fprintf(stdout,"     PID NAME RPRI CPRI STATE  %%CPU     %%STK FLGS   EXEC TIME\n");
    319319
    320320  for (;;)
     
    371371    }
    372372
    373     printf ("\x1b[4;0H");
     373    fprintf(stdout,"\x1b[4;0H");
    374374
    375375    total_time = 0;
     
    405405      priority = rtems_capture_task_real_priority (tasks[i]);
    406406
    407       printf ("\x1b[K");
     407      fprintf(stdout,"\x1b[K");
    408408      rtems_monitor_dump_id (rtems_capture_task_id (tasks[i]));
    409       printf (" ");
     409      fprintf(stdout," ");
    410410      rtems_monitor_dump_name (rtems_capture_task_name (tasks[i]));
    411       printf ("  ");
     411      fprintf(stdout,"  ");
    412412      rtems_monitor_dump_priority (priority);
    413       printf ("  ");
     413      fprintf(stdout,"  ");
    414414      rtems_monitor_dump_priority (rtems_capture_task_curr_priority (tasks[i]));
    415       printf (" ");
     415      fprintf(stdout," ");
    416416      k = rtems_monitor_dump_state (rtems_capture_task_state (tasks[i]));
    417       printf ("%*c %3i.%03i%% ", 6 - k, ' ', task_load / 1000, task_load % 1000);
    418       printf ("%3i%% %c%c%c%c%c", stack_used,
     417      fprintf(stdout,"%*c %3i.%03i%% ", 6 - k, ' ', task_load / 1000, task_load % 1000);
     418      fprintf(stdout,"%3i%% %c%c%c%c%c", stack_used,
    419419              rtems_capture_task_valid (tasks[i]) ? 'a' : 'd',
    420420              rtems_capture_task_flags (tasks[i]) & RTEMS_CAPTURE_TRACED ? 't' : '-',
     
    423423              rtems_capture_task_control_flags (tasks[i]) & RTEMS_CAPTURE_FROM_TO ? 'E' : '-');
    424424      if ((floor > ceiling) && (ceiling > priority))
    425         printf ("--");
     425        fprintf(stdout,"--");
    426426      else
    427         printf ("%c%c",
     427        fprintf(stdout,"%c%c",
    428428                rtems_capture_task_control (tasks[i]) ?
    429429                (rtems_capture_task_control_flags (tasks[i]) &
     
    431431                rtems_capture_watch_global_on () ? 'g' : '-');
    432432
    433       printf ("   %qi\n", rtems_capture_task_time (tasks[i]));
     433      fprintf(stdout,"   %qi\n", rtems_capture_task_time (tasks[i]));
    434434    }
    435435
    436436    while (j)
    437437    {
    438       printf ("\x1b[K\n");
     438      fprintf(stdout,"\x1b[K\n");
    439439      j--;
    440440    }
     
    473473  if (sc != RTEMS_SUCCESSFUL)
    474474  {
    475     printf ("error: cannot obtain the current priority: %s\n", rtems_status_text (sc));
     475    fprintf(stdout,"error: cannot obtain the current priority: %s\n", rtems_status_text (sc));
    476476    return;
    477477  }
     
    486486  if (sc != RTEMS_SUCCESSFUL)
    487487  {
    488     printf ("error: cannot create helper thread: %s\n", rtems_status_text (sc));
     488    fprintf(stdout,"error: cannot create helper thread: %s\n", rtems_status_text (sc));
    489489    return;
    490490  }
     
    494494  if (sc != RTEMS_SUCCESSFUL)
    495495  {
    496     printf ("error: cannot start helper thread: %s\n", rtems_status_text (sc));
     496    fprintf(stdout,"error: cannot start helper thread: %s\n", rtems_status_text (sc));
    497497    rtems_task_delete (id);
    498498    return;
     
    512512      rtems_task_delete (id);
    513513
    514       printf ("load monitoring stopped.\n");
     514      fprintf(stdout,"load monitoring stopped.\n");
    515515
    516516      return;
     
    539539  rtems_task_priority      floor = rtems_capture_watch_get_floor ();
    540540
    541   printf ("watch priority ceiling is %i\n", ceiling);
    542   printf ("watch priority floor is %i\n", floor);
    543   printf ("global watch is %s\n",
     541  fprintf(stdout,"watch priority ceiling is %i\n", ceiling);
     542  fprintf(stdout,"watch priority floor is %i\n", floor);
     543  fprintf(stdout,"global watch is %s\n",
    544544          rtems_capture_watch_global_on () ? "enabled" : "disabled");
    545   printf ("total %d\n", rtems_capture_control_count ());
     545  fprintf(stdout,"total %d\n", rtems_capture_control_count ());
    546546
    547547  while (control)
     
    551551    int lf;
    552552
    553     printf (" ");
     553    fprintf(stdout," ");
    554554    rtems_monitor_dump_id (rtems_capture_control_id (control));
    555     printf (" ");
     555    fprintf(stdout," ");
    556556    rtems_monitor_dump_name (rtems_capture_control_name (control));
    557     printf (" %c%c%c%c%c",
     557    fprintf(stdout," %c%c%c%c%c",
    558558            rtems_capture_control_flags (control) & RTEMS_CAPTURE_WATCH ? 'w' : '-',
    559559            rtems_capture_watch_global_on () ? 'g' : '-',
     
    566566      if (lf && ((fshowed % 16) == 0))
    567567      {
    568         printf ("\n");
     568        fprintf(stdout,"\n");
    569569        lf = 0;
    570570      }
     
    575575      if (rtems_capture_control_from_name (control, f))
    576576      {
    577         printf ("  %2i:", f);
     577        fprintf(stdout,"  %2i:", f);
    578578        rtems_monitor_dump_name (rtems_capture_control_from_name (control, f));
    579         printf ("/");
     579        fprintf(stdout,"/");
    580580        rtems_monitor_dump_id (rtems_capture_control_from_id (control, f));
    581581        fshowed++;
     
    585585
    586586    if (lf)
    587       printf ("\n");
     587      fprintf(stdout,"\n");
    588588
    589589    control = rtems_capture_next_control (control);
     
    613613  if (*valid_name && *valid_id)
    614614  {
    615     printf ("error: too many arguments\n");
     615    fprintf(stdout,"error: too many arguments\n");
    616616    return 0;
    617617  }
     
    670670  if (argc <= 1)
    671671  {
    672     printf (watch_add_usage);
     672    fprintf(stdout,watch_add_usage);
    673673    return;
    674674  }
     
    678678    if (argv[arg][0] == '-')
    679679    {
    680       printf ("warning: option -%c ignored\n", argv[arg][1]);
     680      fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    681681    }
    682682    else
     
    689689  if (!valid_name && !valid_id)
    690690  {
    691     printf("error: no valid name or task id located\n");
     691    fprintf(stdout,"error: no valid name or task id located\n");
    692692    return;
    693693  }
     
    697697  if (sc != RTEMS_SUCCESSFUL)
    698698  {
    699     printf ("error: watch add failed: %s\n", rtems_status_text (sc));
    700     return;
    701   }
    702 
    703   printf ("watch added.\n");
     699    fprintf(stdout,"error: watch add failed: %s\n", rtems_status_text (sc));
     700    return;
     701  }
     702
     703  fprintf(stdout,"watch added.\n");
    704704}
    705705
     
    732732  if (argc <= 1)
    733733  {
    734     printf (watch_del_usage);
     734    fprintf(stdout,watch_del_usage);
    735735    return;
    736736  }
     
    740740    if (argv[arg][0] == '-')
    741741    {
    742       printf ("warning: option -%c ignored\n", argv[arg][1]);
     742      fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    743743    }
    744744    else
     
    751751  if (!valid_name && !valid_id)
    752752  {
    753     printf("error: no valid name or task id located\n");
     753    fprintf(stdout,"error: no valid name or task id located\n");
    754754    return;
    755755  }
     
    759759  if (sc != RTEMS_SUCCESSFUL)
    760760  {
    761     printf ("error: watch delete failed: %s\n", rtems_status_text (sc));
    762     return;
    763   }
    764 
    765   printf ("watch delete.\n");
     761    fprintf(stdout,"error: watch delete failed: %s\n", rtems_status_text (sc));
     762    return;
     763  }
     764
     765  fprintf(stdout,"watch delete.\n");
    766766}
    767767
     
    794794  if (argc <= 2)
    795795  {
    796     printf (watch_control_usage);
     796    fprintf(stdout,watch_control_usage);
    797797    return;
    798798  }
     
    802802    if (argv[arg][0] == '-')
    803803    {
    804       printf ("warning: option -%c ignored\n", argv[arg][1]);
     804      fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    805805    }
    806806    else
     
    817817  if (!valid_name && !valid_id)
    818818  {
    819     printf("error: no valid name or task id located\n");
     819    fprintf(stdout,"error: no valid name or task id located\n");
    820820    return;
    821821  }
     
    825825  if (sc != RTEMS_SUCCESSFUL)
    826826  {
    827     printf ("error: watch control failed: %s\n", rtems_status_text (sc));
    828     return;
    829   }
    830 
    831   printf ("watch %s.\n", enable ? "enabled" : "disabled");
     827    fprintf(stdout,"error: watch control failed: %s\n", rtems_status_text (sc));
     828    return;
     829  }
     830
     831  fprintf(stdout,"watch %s.\n", enable ? "enabled" : "disabled");
    832832}
    833833
     
    856856  if (argc <= 1)
    857857  {
    858     printf (watch_global_usage);
     858    fprintf(stdout,watch_global_usage);
    859859    return;
    860860  }
     
    864864    if (argv[arg][0] == '-')
    865865    {
    866       printf ("warning: option -%c ignored\n", argv[arg][1]);
     866      fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    867867    }
    868868    else
     
    879879  if (sc != RTEMS_SUCCESSFUL)
    880880  {
    881     printf ("error: global watch failed: %s\n", rtems_status_text (sc));
    882     return;
    883   }
    884 
    885   printf ("global watch %s.\n", enable ? "enabled" : "disabled");
     881    fprintf(stdout,"error: global watch failed: %s\n", rtems_status_text (sc));
     882    return;
     883  }
     884
     885  fprintf(stdout,"global watch %s.\n", enable ? "enabled" : "disabled");
    886886}
    887887
     
    910910  if (argc <= 1)
    911911  {
    912     printf (watch_ceiling_usage);
     912    fprintf(stdout,watch_ceiling_usage);
    913913    return;
    914914  }
     
    918918    if (argv[arg][0] == '-')
    919919    {
    920       printf ("warning: option -%c ignored\n", argv[arg][1]);
     920      fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    921921    }
    922922    else
     
    930930  if (sc != RTEMS_SUCCESSFUL)
    931931  {
    932     printf ("error: watch ceiling failed: %s\n", rtems_status_text (sc));
    933     return;
    934   }
    935 
    936   printf ("watch ceiling is %i.\n", priority);
     932    fprintf(stdout,"error: watch ceiling failed: %s\n", rtems_status_text (sc));
     933    return;
     934  }
     935
     936  fprintf(stdout,"watch ceiling is %i.\n", priority);
    937937}
    938938
     
    961961  if (argc <= 1)
    962962  {
    963     printf (watch_floor_usage);
     963    fprintf(stdout,watch_floor_usage);
    964964    return;
    965965  }
     
    969969    if (argv[arg][0] == '-')
    970970    {
    971       printf ("warning: option -%c ignored\n", argv[arg][1]);
     971      fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    972972    }
    973973    else
     
    981981  if (sc != RTEMS_SUCCESSFUL)
    982982  {
    983     printf ("error: watch floor failed: %s\n", rtems_status_text (sc));
    984     return;
    985   }
    986 
    987   printf ("watch floor is %i.\n", priority);
     983    fprintf(stdout,"error: watch floor failed: %s\n", rtems_status_text (sc));
     984    return;
     985  }
     986
     987  fprintf(stdout,"watch floor is %i.\n", priority);
    988988}
    989989
     
    10251025  if (argc <= 2)
    10261026  {
    1027     printf (trigger_set_usage);
     1027    fprintf(stdout,trigger_set_usage);
    10281028    return;
    10291029  }
     
    10331033    if (argv[arg][0] == '-')
    10341034    {
    1035       printf ("warning: option -%c ignored\n", argv[arg][1]);
     1035      fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    10361036    }
    10371037    else
     
    10471047        else
    10481048        {
    1049           printf ("error: the first argument is the trigger type (from/to/edge)\n");
     1049          fprintf(stdout,"error: the first argument is the trigger type (from/to/edge)\n");
    10501050          return;
    10511051        }
     
    10571057        {
    10581058          if (from_valid_name && from_valid_id)
    1059             printf ("warning: extra arguments ignored\n");
     1059            fprintf(stdout,"warning: extra arguments ignored\n");
    10601060          else if (!rtems_capture_cli_get_name_id (argv[arg], &from_valid_name, &from_valid_id,
    10611061                                           &from_name, &from_id))
     
    10651065        {
    10661066          if (to_valid_name && to_valid_id)
    1067             printf ("warning: extra arguments ignored\n");
     1067            fprintf(stdout,"warning: extra arguments ignored\n");
    10681068          else if (!rtems_capture_cli_get_name_id (argv[arg], &to_valid_name, &to_valid_id,
    10691069                                           &to_name, &to_id))
     
    10731073        {
    10741074          if (from_valid_name && from_valid_id && to_valid_name && to_valid_id)
    1075             printf ("warning: extra arguments ignored\n");
     1075            fprintf(stdout,"warning: extra arguments ignored\n");
    10761076          else
    10771077          {
     
    10881088              }
    10891089              else if (to_valid_name)
    1090                 printf ("warning: extra arguments ignored\n");
     1090                fprintf(stdout,"warning: extra arguments ignored\n");
    10911091              else
    10921092              {
     
    11031103              }
    11041104              else if (to_valid_id)
    1105                 printf ("warning: extra arguments ignored\n");
     1105                fprintf(stdout,"warning: extra arguments ignored\n");
    11061106              else
    11071107              {
     
    11181118  if ((trigger == rtems_capture_to_any) && !from_valid_name && !from_valid_id)
    11191119  {
    1120     printf ("error: a from trigger need a to name or id\n");
     1120    fprintf(stdout,"error: a from trigger need a to name or id\n");
    11211121    return;
    11221122  }
     
    11241124  if ((trigger == rtems_capture_from_any) && !to_valid_name && !to_valid_id)
    11251125  {
    1126     printf ("error: a to trigger need a from name or id\n");
     1126    fprintf(stdout,"error: a to trigger need a from name or id\n");
    11271127    return;
    11281128  }
     
    11311131      ((!from_valid_name && !from_valid_id) || (!to_valid_name && !to_valid_id)))
    11321132  {
    1133     printf ("error: an edge trigger need a from and to name or id\n");
     1133    fprintf(stdout,"error: an edge trigger need a from and to name or id\n");
    11341134    return;
    11351135  }
     
    11391139  if (sc != RTEMS_SUCCESSFUL)
    11401140  {
    1141     printf ("error: setting the trigger failed: %s\n", rtems_status_text (sc));
    1142     return;
    1143   }
    1144 
    1145   printf ("trigger set.\n");
     1141    fprintf(stdout,"error: setting the trigger failed: %s\n", rtems_status_text (sc));
     1142    return;
     1143  }
     1144
     1145  fprintf(stdout,"trigger set.\n");
    11461146}
    11471147
     
    11851185        if (arg == argc)
    11861186        {
    1187           printf ("error: option -r requires number\n");
     1187          fprintf(stdout,"error: option -r requires number\n");
    11881188          return;
    11891189        }
     
    11941194          if (!isdigit (argv[arg][i]))
    11951195          {
    1196             printf ("error: option -r requires number and currently it is not\n");
     1196            fprintf(stdout,"error: option -r requires number and currently it is not\n");
    11971197            return;
    11981198          }
     
    12011201      }
    12021202      else
    1203         printf ("warning: option -%c ignored\n", argv[arg][1]);
     1203        fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    12041204    }
    12051205  }
     
    12131213    if (sc != RTEMS_SUCCESSFUL)
    12141214    {
    1215       printf ("error: trace read failed: %s\n", rtems_status_text (sc));
     1215      fprintf(stdout,"error: trace read failed: %s\n", rtems_status_text (sc));
    12161216      rtems_capture_flush (0);
    12171217      return;
     
    12241224    {
    12251225      if (csv)
    1226         printf ("%08x,%03d,%03d,%04x,%d,%d\n",
     1226        fprintf(stdout,"%08x,%03d,%03d,%04x,%d,%d\n",
    12271227                (uint32_t  ) rec->task,
    12281228                (rec->events >> RTEMS_CAPTURE_REAL_PRIORITY_EVENT) & 0xff,
     
    12461246          if (event & 1)
    12471247          {
    1248             printf ("%9li.%06li ", (unsigned long) (t / 1000000),
     1248            fprintf(stdout,"%9li.%06li ", (unsigned long) (t / 1000000),
    12491249                    (unsigned long) (t % 1000000));
    12501250            rtems_monitor_dump_id (rtems_capture_task_id (rec->task));
    1251             printf (" ");
     1251            fprintf(stdout," ");
    12521252            rtems_monitor_dump_name (rtems_capture_task_name (rec->task));
    1253             printf (" %3i %3i %s\n",
     1253            fprintf(stdout," %3i %3i %s\n",
    12541254                    (rec->events >> RTEMS_CAPTURE_REAL_PRIORITY_EVENT) & 0xff,
    12551255                    (rec->events >> RTEMS_CAPTURE_CURR_PRIORITY_EVENT) & 0xff,
     
    12981298        prime = 0;
    12991299      else
    1300         printf ("warning: option -%c ignored\n", argv[arg][1]);
     1300        fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
    13011301    }
    13021302  }
     
    13061306  if (sc != RTEMS_SUCCESSFUL)
    13071307  {
    1308     printf ("error: flush failed: %s\n", rtems_status_text (sc));
    1309     return;
    1310   }
    1311 
    1312   printf ("trace buffer flushed and %s.\n", prime ? "primed" : "not primed");
     1308    fprintf(stdout,"error: flush failed: %s\n", rtems_status_text (sc));
     1309    return;
     1310  }
     1311
     1312  fprintf(stdout,"trace buffer flushed and %s.\n", prime ? "primed" : "not primed");
    13131313}
    13141314
  • cpukit/libmisc/cpuuse/cpuuse.c

    r0fdc099 r714f06c  
    6161  }
    6262
    63   printf("CPU Usage by thread\n");
     63  fprintf(stdout,"CPU Usage by thread\n");
    6464#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
    65   printf( "   ID        NAME        TICKS    PERCENT\n" );
     65  fprintf(stdout, "   ID        NAME        TICKS    PERCENT\n" );
    6666#else
    67   printf( "   ID        NAME        TICKS\n" );
     67  fprintf(stdout, "   ID        NAME        TICKS\n" );
    6868#endif
    6969
     
    103103
    104104#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
    105         printf( "0x%08x   %4s    %8d     %5.3f\n",
     105        fprintf(stdout, "0x%08x   %4s    %8d     %5.3f\n",
    106106          the_thread->Object.id,
    107107          name,
     
    112112        );
    113113#else
    114         printf( "0x%08x   %4s   %8d\n",
     114        fprintf(stdout, "0x%08x   %4s   %8d\n",
    115115          the_thread->Object.id,
    116116          name,
     
    122122  }
    123123
    124   printf(
     124  fprintf(stdout,
    125125    "\nTicks since last reset = %d\n",
    126126    _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
    127127  );
    128   printf( "\nTotal Units = %d\n", total_units );
     128  fprintf(stdout, "\nTotal Units = %d\n", total_units );
    129129}
    130130
  • cpukit/libmisc/dumpbuf/dumpbuf.c

    r0fdc099 r714f06c  
    7676  strcat( line_buffer, "|\n" );
    7777
    78   printf( line_buffer );
     78  fprintf(stdout, line_buffer );
    7979}
  • cpukit/libmisc/fsmount/fsmount.c

    r0fdc099 r714f06c  
    137137      if (tmp_rc != 0) {
    138138        if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNTPNT_CRTERR)) {
    139           printf("fsmount: creation of mount point \"%s\" failed: %s\n",
     139          fprintf(stdout,"fsmount: creation of mount point \"%s\" failed: %s\n",
    140140                 fstab_ptr->mount_point,
    141141                 strerror(errno));
     
    158158      if (tmp_rc != RTEMS_SUCCESSFUL) {
    159159        if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_FAILED)) {
    160           printf("fsmount: mounting of \"%s\" to"
     160          fprintf(stdout,"fsmount: mounting of \"%s\" to"
    161161                 " \"%s\" failed: %s\n",
    162162                 fstab_ptr->dev,
     
    171171      else {
    172172        if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_OK)) {
    173           printf("fsmount: mounting of \"%s\" to"
     173          fprintf(stdout,"fsmount: mounting of \"%s\" to"
    174174                 " \"%s\" succeeded\n",
    175175                 fstab_ptr->dev,
  • cpukit/libmisc/monitor/mon-command.c

    r0fdc099 r714f06c  
    236236
    237237  if (!logged_in)
    238     printf ("\nMonitor ready, press enter to login.\n\n");
     238    fprintf(stdout,"\nMonitor ready, press enter to login.\n\n");
    239239  else
    240     printf ("%s $ ", monitor_prompt);
     240    fprintf(stdout,"%s $ ", monitor_prompt);
    241241
    242242  while (1)
     
    259259         * which version of the monitor code people are using.
    260260         */
    261         printf("%s $ ", monitor_prompt);
     261        fprintf(stdout,"%s $ ", monitor_prompt);
    262262      }
    263263    }
     
    269269        {
    270270          case KEYS_END:
    271             printf (buffer + pos);
     271            fprintf(stdout,buffer + pos);
    272272            pos = (int) strlen (buffer);
    273273            break;
    274274
    275275          case KEYS_HOME:
    276             printf ("\r%s $ ", monitor_prompt);
     276            fprintf(stdout,"\r%s $ ", monitor_prompt);
    277277            pos = 0;
    278278            break;
     
    313313                      RTEMS_COMMAND_BUFFER_SIZE);
    314314              pos = history_pos[history];
    315               printf ("\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
    316               printf ("\r%s $ %s", monitor_prompt, buffer);
     315              fprintf(stdout,"\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
     316              fprintf(stdout,"\r%s $ %s", monitor_prompt, buffer);
    317317              end = (int) strlen (buffer);
    318318              for (bs = 0; bs < (end - pos); bs++)
     
    330330                      RTEMS_COMMAND_BUFFER_SIZE);
    331331              pos = history_pos[history];
    332               printf ("\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
    333               printf ("\r%s $ %s", monitor_prompt, buffer);
     332              fprintf(stdout,"\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
     333              fprintf(stdout,"\r%s $ %s", monitor_prompt, buffer);
    334334              end = (int) strlen (buffer);
    335335              for (bs = 0; bs < (end - pos); bs++)
     
    344344              int bs;
    345345              strcpy (&buffer[pos], &buffer[pos + 1]);
    346               printf ("\r%s $ %s", monitor_prompt, buffer);
     346              fprintf(stdout,"\r%s $ %s", monitor_prompt, buffer);
    347347              end = (int) strlen (buffer);
    348348              for (bs = 0; bs < (end - pos); bs++)
     
    364364              pos--;
    365365              strcpy (buffer + pos, buffer + pos + 1);
    366               printf ("\b%s \b", buffer + pos);
     366              fprintf(stdout,"\b%s \b", buffer + pos);
    367367              for (bs = 0; bs < ((int) strlen (buffer) - pos); bs++)
    368368                putchar ('\b');
     
    374374             * Process the command.
    375375             */
    376             printf ("\n");
     376            fprintf(stdout,"\n");
    377377            repeating = 1;
    378378            /*
     
    432432                for (ch = end + 1; ch > pos; ch--)
    433433                  buffer[ch] = buffer[ch - 1];
    434                 printf (buffer + pos);
     434                fprintf(stdout,buffer + pos);
    435435                for (bs = 0; bs < (end - pos + 1); bs++)
    436436                  putchar ('\b');
     
    506506#if defined(RTEMS_UNIX)
    507507  /* RTEMS on unix gets so many interrupt system calls this is hosed */
    508   printf ("%s> ", monitor_prompt);
     508  fprintf(stdout,"%s> ", monitor_prompt);
    509509  fflush (stdout);
    510510  while (gets(command) == (char *) 0)
     
    590590    int         c;
    591591
    592     printf ("%s", help_cmd->command);
     592    fprintf(stdout,"%s", help_cmd->command);
    593593
    594594    if (help_len == 0)
    595595    {
    596       printf (" - No help associated.\n");
     596      fprintf(stdout," - No help associated.\n");
    597597      return;
    598598    }
     
    600600    while (help_len)
    601601    {
    602       printf ("%*c", spaces, ' ');
     602      fprintf(stdout,"%*c", spaces, ' ');
    603603
    604604      if (line_one)
    605         printf (" - ");
     605        fprintf(stdout," - ");
    606606
    607607      spaces   = max_cmd_len + 2;
     
    639639          putchar (help[c]);
    640640
    641       printf ("\n");
     641      fprintf(stdout,"\n");
    642642
    643643      help     += show_this_line;
     
    689689      rtems_monitor_show_help (command, strlen (command_string));
    690690    else
    691       printf ("Unrecognised command; try just 'help'\n");
     691      fprintf(stdout,"Unrecognised command; try just 'help'\n");
    692692    return;
    693693  }
  • cpukit/libmisc/monitor/mon-config.c

    r0fdc099 r714f06c  
    8585)
    8686{
    87     printf("\
     87    fprintf(stdout,"\
    8888INITIAL (startup) Configuration Info\n");
    8989/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
     
    102102
    103103    length = 0;
    104     length += printf("WORKSPACE");
     104    length += fprintf(stdout,"WORKSPACE");
    105105    length += rtems_monitor_pad(DATACOL, length);
    106     length += printf("start: %p;  size: 0x%x\n",
     106    length += fprintf(stdout,"start: %p;  size: 0x%x\n",
    107107                     monitor_config->work_space_start,
    108108                     monitor_config->work_space_size);
    109109
    110110    length = 0;
    111     length += printf("TIME");
     111    length += fprintf(stdout,"TIME");
    112112    length += rtems_monitor_pad(DATACOL, length);
    113     length += printf("usec/tick: %d;  tick/timeslice: %d;  tick/sec: %d\n",
     113    length += fprintf(stdout,"usec/tick: %d;  tick/timeslice: %d;  tick/sec: %d\n",
    114114                     monitor_config->microseconds_per_tick,
    115115                     monitor_config->ticks_per_timeslice,
     
    117117
    118118    length = 0;
    119     length += printf("MAXIMUMS");
     119    length += fprintf(stdout,"MAXIMUMS");
    120120    length += rtems_monitor_pad(DATACOL, length);
    121     length += printf("tasks: %d;  timers: %d;  sems: %d;  que's: %d;  ext's: %d\n",
     121    length += fprintf(stdout,"tasks: %d;  timers: %d;  sems: %d;  que's: %d;  ext's: %d\n",
    122122                     monitor_config->maximum_tasks,
    123123                     monitor_config->maximum_timers,
     
    127127    length = 0;
    128128    length += rtems_monitor_pad(CONTCOL, length);
    129     length += printf("partitions: %d;  regions: %d;  ports: %d;  periods: %d\n",
     129    length += fprintf(stdout,"partitions: %d;  regions: %d;  ports: %d;  periods: %d\n",
    130130                     monitor_config->maximum_partitions,
    131131                     monitor_config->maximum_regions,
  • cpukit/libmisc/monitor/mon-dname.c

    r0fdc099 r714f06c  
    8787)
    8888{
    89     printf("\
     89    fprintf(stdout,"\
    9090  Major:Minor   Name\n");
    9191/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
     
    104104    length += rtems_monitor_pad(6, length);
    105105    length += rtems_monitor_dump_hex(monitor_dname->major);
    106     length += printf(":");
     106    length += fprintf(stdout,":");
    107107    length += rtems_monitor_dump_hex(monitor_dname->minor);
    108108
    109109    length += rtems_monitor_pad(16, length);
    110     length += printf("%.*s",
     110    length += fprintf(stdout,"%.*s",
    111111                     (int) sizeof(monitor_dname->name_string),
    112112                     (char *) monitor_dname->name_string);
    113113
    114     length += printf("\n");
     114    length += fprintf(stdout,"\n");
    115115    length = 0;
    116116}
  • cpukit/libmisc/monitor/mon-driver.c

    r0fdc099 r714f06c  
    9696)
    9797{
    98     printf("\
     98    fprintf(stdout,"\
    9999  Major      Entry points\n");
    100100/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
     
    111111    uint32_t            length = 0;
    112112
    113     length += printf("  %d", monitor_driver->id);
     113    length += fprintf(stdout,"  %d", monitor_driver->id);
    114114
    115115    length += rtems_monitor_pad(13, length);
    116     length += printf("init: ");
     116    length += fprintf(stdout,"init: ");
    117117    length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
    118     length += printf(";  control: ");
     118    length += fprintf(stdout,";  control: ");
    119119    length += rtems_monitor_symbol_dump(&monitor_driver->control, verbose);
    120     length += printf("\n");
     120    length += fprintf(stdout,"\n");
    121121    length = 0;
    122122
    123123    length += rtems_monitor_pad(13, length);
    124124
    125     length += printf("open: ");
     125    length += fprintf(stdout,"open: ");
    126126    length += rtems_monitor_symbol_dump(&monitor_driver->open, verbose);
    127     length += printf(";  close: ");
     127    length += fprintf(stdout,";  close: ");
    128128    length += rtems_monitor_symbol_dump(&monitor_driver->close, verbose);
    129     length += printf("\n");
     129    length += fprintf(stdout,"\n");
    130130    length = 0;
    131131
    132132    length += rtems_monitor_pad(13, length);
    133133
    134     length += printf("read: ");
     134    length += fprintf(stdout,"read: ");
    135135    length += rtems_monitor_symbol_dump(&monitor_driver->read, verbose);
    136     length += printf(";  write: ");
     136    length += fprintf(stdout,";  write: ");
    137137    length += rtems_monitor_symbol_dump(&monitor_driver->write, verbose);
    138     length += printf("\n");
     138    length += fprintf(stdout,"\n");
    139139    length = 0;
    140140}
  • cpukit/libmisc/monitor/mon-extension.c

    r0fdc099 r714f06c  
    4747)
    4848{
    49     printf("\
     49    fprintf(stdout,"\
    5050  ID       NAME\n");
    5151/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
     
    7373
    7474    length += rtems_monitor_pad(18, length);
    75     length += printf("create: ");
     75    length += fprintf(stdout,"create: ");
    7676    length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
    77     length += printf(";  start: ");
     77    length += fprintf(stdout,";  start: ");
    7878    length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
    79     length += printf(";  restart: ");
     79    length += fprintf(stdout,";  restart: ");
    8080    length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
    81     length += printf("\n");
     81    length += fprintf(stdout,"\n");
    8282    length = 0;
    8383
    8484    length += rtems_monitor_pad(18, length);
    85     length += printf("delete: ");
     85    length += fprintf(stdout,"delete: ");
    8686    length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
    87     length += printf(";  switch: ");
     87    length += fprintf(stdout,";  switch: ");
    8888    length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
    89     length += printf(";  begin: ");
     89    length += fprintf(stdout,";  begin: ");
    9090    length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
    91     length += printf("\n");
     91    length += fprintf(stdout,"\n");
    9292    length = 0;
    9393
    9494    length += rtems_monitor_pad(18, length);
    95     length += printf("exitted: ");
     95    length += fprintf(stdout,"exitted: ");
    9696    length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
    97     length += printf(";  fatal: ");
     97    length += fprintf(stdout,";  fatal: ");
    9898    length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
    99     length += printf("\n");
     99    length += fprintf(stdout,"\n");
    100100    length = 0;
    101     printf("\n");
     101    fprintf(stdout,"\n");
    102102}
  • cpukit/libmisc/monitor/mon-itask.c

    r0fdc099 r714f06c  
    7575)
    7676{
    77     printf("\
     77    fprintf(stdout,"\
    7878  #    NAME   ENTRY        ARGUMENT    PRIO   MODES  ATTRIBUTES   STACK SIZE\n");
    7979/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
     
    102102
    103103    length += rtems_monitor_pad(25, length);
    104     length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
     104    length += fprintf(stdout,"%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
    105105
    106106    length += rtems_monitor_pad(39, length);
     
    114114
    115115    length += rtems_monitor_pad(66, length);
    116     length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
     116    length += fprintf(stdout,"%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
    117117
    118     printf("\n");
     118    fprintf(stdout,"\n");
    119119}
  • cpukit/libmisc/monitor/mon-monitor.c

    r0fdc099 r714f06c  
    327327
    328328        default:
    329             printf("invalid syntax, try 'help node'\n");
     329            fprintf(stdout,"invalid syntax, try 'help node'\n");
    330330            break;
    331331    }
     
    399399            if (sp == 0)
    400400            {
    401                 printf("could not define symbol '%s'\n", symbol);
     401                fprintf(stdout,"could not define symbol '%s'\n", symbol);
    402402                goto done;
    403403            }
     
    405405        else
    406406        {
    407             printf("parsing error on '%s'\n", buffer);
     407            fprintf(stdout,"parsing error on '%s'\n", buffer);
    408408            goto done;
    409409        }
     
    479479    if (tcgetattr (STDIN_FILENO, &term) < 0)
    480480    {
    481       printf("rtems-monitor: cannot get terminal attributes.\n");
     481      fprintf(stdout,"rtems-monitor: cannot get terminal attributes.\n");
    482482    }
    483483    else
     
    500500      if (tcsetattr (STDIN_FILENO, TCSANOW, &term) < 0)
    501501      {
    502         printf("cannot set terminal attributes\n");
     502        fprintf(stdout,"cannot set terminal attributes\n");
    503503      }
    504504    }
     
    527527        {
    528528            /* no command */
    529             printf("Unrecognised command; try 'help'\n");
     529            fprintf(stdout,"Unrecognised command; try 'help'\n");
    530530            continue;
    531531        }
  • cpukit/libmisc/monitor/mon-mpci.c

    r0fdc099 r714f06c  
    9898)
    9999{
    100     printf("\
     100    fprintf(stdout,"\
    101101           max     max     max     default    max\n\
    102102   node   nodes  globals  proxies  timeout  pktsize\n");
     
    117117
    118118    length += rtems_monitor_pad(2, length);
    119     length += printf("  %d", monitor_mpci->node);
     119    length += fprintf(stdout,"  %d", monitor_mpci->node);
    120120    length += rtems_monitor_pad(11, length);
    121     length += printf("%d", monitor_mpci->maximum_nodes);
     121    length += fprintf(stdout,"%d", monitor_mpci->maximum_nodes);
    122122
    123123    length += rtems_monitor_pad(18, length);
     
    133133    length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
    134134
    135     printf("\n");
     135    fprintf(stdout,"\n");
    136136    length = 0;
    137137    length += rtems_monitor_pad(DATACOL, length);
    138138
    139     length += printf("init: ");
     139    length += fprintf(stdout,"init: ");
    140140    length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
    141141
    142     printf("\n");
     142    fprintf(stdout,"\n");
    143143    length = 0;
    144144    length += rtems_monitor_pad(DATACOL, length);
    145145
    146     length += printf("get: ");
     146    length += fprintf(stdout,"get: ");
    147147    length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
    148     length += printf(";  return: ");
     148    length += fprintf(stdout,";  return: ");
    149149    length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
    150150
    151     printf("\n");
     151    fprintf(stdout,"\n");
    152152    length = 0;
    153153    length += rtems_monitor_pad(DATACOL, length);
    154154
    155     length += printf("send: ");
     155    length += fprintf(stdout,"send: ");
    156156    length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
    157     length += printf(";  receive: ");
     157    length += fprintf(stdout,";  receive: ");
    158158    length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
    159159
    160     printf("\n");
     160    fprintf(stdout,"\n");
    161161    length = 0;
    162162}
  • cpukit/libmisc/monitor/mon-object.c

    r0fdc099 r714f06c  
    331331        if (type == RTEMS_MONITOR_OBJECT_INVALID)
    332332        {
    333             printf("A type must be specified to \"dump all\"\n");
     333            fprintf(stdout,"A type must be specified to \"dump all\"\n");
    334334            goto done;
    335335        }
     
    372372            if (info == 0)
    373373            {
    374 not_found:      printf("Invalid or unsupported type %d\n", type);
     374not_found:      fprintf(stdout,"Invalid or unsupported type %d\n", type);
    375375                goto done;
    376376            }
  • cpukit/libmisc/monitor/mon-prmisc.c

    r0fdc099 r714f06c  
    2323rtems_monitor_separator(void)
    2424{
    25     printf("------------------------------------------------------------------------------\n");
     25    fprintf(stdout,"------------------------------------------------------------------------------\n");
    2626}
    2727
     
    3939        pad_length = destination_column - current_column;
    4040
    41     return printf("%*s", pad_length, "");
     41    return fprintf(stdout,"%*s", pad_length, "");
    4242}
    4343
     
    4646{
    4747    if (isprint(ch))
    48         return printf("%c", ch);
     48        return fprintf(stdout,"%c", ch);
    4949    else
    50         return printf("%02x", ch);
     50        return fprintf(stdout,"%02x", ch);
    5151}
    5252
     
    5454rtems_monitor_dump_decimal(uint32_t   num)
    5555{
    56     return printf("%4d", num);
     56    return fprintf(stdout,"%4d", num);
    5757}
    5858
     
    6060rtems_monitor_dump_hex(uint32_t   num)
    6161{
    62     return printf("0x%x", num);
     62    return fprintf(stdout,"0x%x", num);
    6363}
    6464
     
    7878        {
    7979            if (length)
    80                 length += printf("%s", separator);
     80                length += fprintf(stdout,"%s", separator);
    8181
    8282            name = rtems_assoc_name_by_local(ap, b);
    8383
    8484            if (name)
    85                 length += printf("%s", name);
     85                length += fprintf(stdout,"%s", name);
    8686            else
    87                 length += printf("0x%x", b);
     87                length += fprintf(stdout,"0x%x", b);
    8888        }
    8989
     
    9494rtems_monitor_dump_id(rtems_id id)
    9595{
    96     return printf("%08x", id);
     96    return fprintf(stdout,"%08x", id);
    9797}
    9898
     
    122122rtems_monitor_dump_priority(rtems_task_priority priority)
    123123{
    124     return printf("%3d", priority);
     124    return fprintf(stdout,"%3d", priority);
    125125}
    126126
     
    153153
    154154    if (state == STATES_READY)  /* assoc doesn't deal with this as it is 0 */
    155         length += printf("READY");
     155        length += fprintf(stdout,"READY");
    156156
    157157    length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_state_assoc,
     
    176176
    177177    if (attributes == RTEMS_DEFAULT_ATTRIBUTES)  /* value is 0 */
    178         length += printf("DEFAULT");
     178        length += fprintf(stdout,"DEFAULT");
    179179
    180180    length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_attribute_assoc,
     
    197197
    198198    if (modes == RTEMS_DEFAULT_MODES)  /* value is 0 */
    199         length += printf("P:T:nA");
     199        length += fprintf(stdout,"P:T:nA");
    200200
    201201    length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_modes_assoc,
     
    247247
    248248    if (events == EVENT_SETS_NONE_PENDING)  /* value is 0 */
    249         length += printf("NONE");
     249        length += fprintf(stdout,"NONE");
    250250
    251251    length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_events_assoc,
     
    263263    for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
    264264        if (notepad[i])
    265             length += printf("%d: 0x%x ", i, notepad[i]);
    266 
    267     return length;
    268 }
     265            length += fprintf(stdout,"%d: 0x%x ", i, notepad[i]);
     266
     267    return length;
     268}
  • cpukit/libmisc/monitor/mon-queue.c

    r0fdc099 r714f06c  
    3131)
    3232{
    33     printf("\
     33    fprintf(stdout,"\
    3434  ID       NAME   ATTRIBUTES   PEND   MAXPEND  MAXSIZE\n");
    3535/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
     
    6565    length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size);
    6666
    67     printf("\n");
     67    fprintf(stdout,"\n");
    6868}
  • cpukit/libmisc/monitor/mon-symbols.c

    r0fdc099 r714f06c  
    397397    {
    398398        if (canonical_symbol->offset == 0)
    399             length += printf("%.*s",
     399            length += fprintf(stdout,"%.*s",
    400400                             (int) sizeof(canonical_symbol->name),
    401401                             canonical_symbol->name);
    402402        else
    403             length += printf("<%.*s+0x%x>",
     403            length += fprintf(stdout,"<%.*s+0x%x>",
    404404                             (int) sizeof(canonical_symbol->name),
    405405                             canonical_symbol->name,
    406406                             canonical_symbol->offset);
    407407        if (verbose)
    408             length += printf(" [0x%x]", canonical_symbol->value);
     408            length += fprintf(stdout," [0x%x]", canonical_symbol->value);
    409409    }
    410410    else
    411         length += printf("[0x%x]", canonical_symbol->value);
     411        length += fprintf(stdout,"[0x%x]", canonical_symbol->value);
    412412
    413413    return length;
     
    440440        rtems_monitor_symbol_canonical(&canonical_symbol, sp);
    441441        rtems_monitor_symbol_dump(&canonical_symbol, TRUE);
    442         printf("\n");
     442        fprintf(stdout,"\n");
    443443    }
    444444}
     
    481481            rtems_monitor_symbol_canonical_by_name(&canonical_symbol, argv[arg]);
    482482            rtems_monitor_symbol_dump(&canonical_symbol, verbose);
    483             printf("\n");
     483            fprintf(stdout,"\n");
    484484        }
    485485    }
  • cpukit/libmisc/monitor/mon-task.c

    r0fdc099 r714f06c  
    5353)
    5454{
    55     printf("\
     55    fprintf(stdout,"\
    5656  ID       NAME   PRIO   STAT   MODES  EVENTS   WAITID  WAITARG  NOTES\n");
    5757/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
     
    9393    length += rtems_monitor_pad(65, length);
    9494    length += rtems_monitor_dump_notepad(monitor_task->notepad);
    95     printf("\n");
     95    fprintf(stdout,"\n");
    9696}
  • cpukit/libmisc/rtmonuse/rtmonuse.c

    r0fdc099 r714f06c  
    138138
    139139  if ( !Period_usage_Information ) {
    140     printf( "Period statistics library is not initialized\n" );
     140    fprintf(stdout, "Period statistics library is not initialized\n" );
    141141    return;
    142142  }
    143143
    144   printf( "Period information by period\n" );
    145   printf( "   ID      OWNER   PERIODS  MISSED    CPU TIME    WALL TIME\n" );
     144  fprintf(stdout, "Period information by period\n" );
     145  fprintf(stdout, "   ID      OWNER   PERIODS  MISSED    CPU TIME    WALL TIME\n" );
    146146
    147147  /*
     
    192192
    193193
    194     printf(
     194    fprintf(stdout,
    195195      "0x%08x  %4s   %6d   %3d       %d/%d/%5.2f    %d/%d/%3.2f\n",
    196196      the_usage->id,
  • cpukit/libmisc/shell/cmds.c

    r0fdc099 r714f06c  
    131131 if (!max) max=20;
    132132 for (m=0;m<max;m++) {
    133   printf("0x%08X ",adr);
     133  fprintf(stdout,"0x%08X ",adr);
    134134  pb=(unsigned char*) adr;
    135135  for (n=0;n<16;n++)
    136    printf("%02X%c",pb[n],n==7?'-':' ');
     136   fprintf(stdout,"%02X%c",pb[n],n==7?'-':' ');
    137137  for (n=0;n<16;n++) {
    138    printf("%c",isprint(pb[n])?pb[n]:'.');
     138   fprintf(stdout,"%c",isprint(pb[n])?pb[n]:'.');
    139139  };
    140   printf("\n");
     140  fprintf(stdout,"\n");
    141141  adr+=16;
    142142 };
     
    154154 if (!max) max=20;
    155155 for (m=0;m<max;m++) {
    156   printf("0x%08X ",adr);
     156  fprintf(stdout,"0x%08X ",adr);
    157157  pw=(unsigned short*) adr;
    158158  for (n=0;n<8;n++)
    159    printf("%02X %02X%c",pw[n]/0x100,pw[n]%0x100,n==3?'-':' ');
     159   fprintf(stdout,"%02X %02X%c",pw[n]/0x100,pw[n]%0x100,n==3?'-':' ');
    160160  for (n=0;n<8;n++) {
    161    printf("%c",isprint(pw[n]/0x100)?pw[n]/0x100:'.');
    162    printf("%c",isprint(pw[n]%0x100)?pw[n]%0x100:'.');
     161   fprintf(stdout,"%c",isprint(pw[n]/0x100)?pw[n]/0x100:'.');
     162   fprintf(stdout,"%c",isprint(pw[n]%0x100)?pw[n]%0x100:'.');
    163163  };
    164   printf("\n");
     164  fprintf(stdout,"\n");
    165165  adr+=16;
    166166 };
     
    173173 int n,i;
    174174 if (argc<3) {
    175   printf("too few arguments\n");
     175  fprintf(stdout,"too few arguments\n");
    176176  return 0;
    177177 };
     
    191191 unsigned char value;
    192192 if (argc<4) {
    193   printf("too few arguments\n");
     193  fprintf(stdout,"too few arguments\n");
    194194  return 0;
    195195 };
     
    207207 int  size;
    208208 if (argc<4) {
    209   printf("too few arguments\n");
     209  fprintf(stdout,"too few arguments\n");
    210210  return 0;
    211211 };
     
    231231{
    232232  rtems_interrupt_level level;
    233   printf ("Waiting for watchdog ... ");
     233  fprintf(stdout,"Waiting for watchdog ... ");
    234234  tcdrain(fileno(stdout));
    235235
     
    245245{
    246246 if (argc<3) {
    247   printf("too few arguments\n");
     247  fprintf(stdout,"too few arguments\n");
    248248  return 1;
    249249 };
    250250 if (!shell_alias_cmd(argv[1],argv[2])) {
    251   printf("unable to make an alias(%s,%s)\n",argv[1],argv[2]);
     251  fprintf(stdout,"unable to make an alias(%s,%s)\n",argv[1],argv[2]);
    252252 };
    253253 return 0;
     
    275275   if ((dirp = opendir(fname)) == NULL)
    276276   {
    277       printf("%s: No such file or directory.\n", fname);
     277      fprintf(stdout,"%s: No such file or directory.\n", fname);
    278278      return errno;
    279279   }
     
    292292         grp=getgrgid(stat_buf.st_gid);
    293293         group=grp?grp->gr_name:"nogrp";
    294          printf("%c%c%c%c%c%c%c%c%c%c %3d %6.6s %6.6s %11d %s %s%c\n",
     294         fprintf(stdout,"%c%c%c%c%c%c%c%c%c%c %3d %6.6s %6.6s %11d %s %s%c\n",
    295295                 (S_ISLNK(stat_buf.st_mode)?('l'):
    296296                    (S_ISDIR(stat_buf.st_mode)?('d'):('-'))),
     
    314314      }
    315315   }
    316    printf("%d files %d bytes occupied\n",n,size);
     316   fprintf(stdout,"%d files %d bytes occupied\n",n,size);
    317317   closedir(dirp);
    318318   return 0;
     
    322322   char dir[1024];
    323323   getcwd(dir,1024);
    324    printf("%s\n",dir);
     324   fprintf(stdout,"%s\n",dir);
    325325   return 0;
    326326}
     
    331331   if (argc>1) dir=argv[1];
    332332   if (chdir(dir)) {
    333     printf("chdir to '%s' failed:%s\n",dir,strerror(errno));
     333    fprintf(stdout,"chdir to '%s' failed:%s\n",dir,strerror(errno));
    334334    return errno;
    335335   };
     
    344344    dir=argv[n++];
    345345    if (mkdir(dir,S_IRWXU|S_IRWXG|S_IRWXO)) {
    346       printf("mkdir '%s' failed:%s\n",dir,strerror(errno));
     346      fprintf(stdout,"mkdir '%s' failed:%s\n",dir,strerror(errno));
    347347    };
    348348   };
     
    357357   while (n<argc) {
    358358    dir=argv[n++];
    359     if (rmdir(dir)) printf("rmdir '%s' failed:%s\n",dir,strerror(errno));
     359    if (rmdir(dir)) fprintf(stdout,"rmdir '%s' failed:%s\n",dir,strerror(errno));
    360360   };
    361361   return errno;
     
    366366 if (argc==2) new_root=argv[1];
    367367 if (chroot(new_root)<0) {
    368   printf("error %s:chroot(%s);\n",strerror(errno),new_root);
     368  fprintf(stdout,"error %s:chroot(%s);\n",strerror(errno),new_root);
    369369  return -1;
    370370 };
     
    386386   while (n<argc) {
    387387    if (unlink(argv[n])) {
    388      printf("error %s:rm %s\n",strerror(errno),argv[n]);
     388     fprintf(stdout,"error %s:rm %s\n",strerror(errno),argv[n]);
    389389     return -1;
    390390    };
     
    400400  time_t t;
    401401  time(&t);
    402   printf("%s", ctime(&t));
     402  fprintf(stdout,"%s", ctime(&t));
    403403  return 0;
    404404}
     
    406406int main_logoff(int argc,char *argv[])
    407407{
    408   printf("logoff from the system...");
     408  fprintf(stdout,"logoff from the system...");
    409409  current_shell_env->exit_shell=TRUE;
    410410  return 0;
     
    413413int main_tty   (int argc,char *argv[])
    414414{
    415   printf("%s\n",ttyname(fileno(stdin)));
     415  fprintf(stdout,"%s\n",ttyname(fileno(stdin)));
    416416  return 0;
    417417}
     
    421421   struct passwd     * pwd;
    422422   pwd=getpwuid(getuid());
    423    printf("%s\n",pwd?pwd->pw_name:"nobody");
     423   fprintf(stdout,"%s\n",pwd?pwd->pw_name:"nobody");
    424424   return 0;
    425425}
     
    431431   pwd=getpwuid(getuid());
    432432   grp=getgrgid(getgid());
    433    printf("uid=%d(%s),gid=%d(%s),",
     433   fprintf(stdout,"uid=%d(%s),gid=%d(%s),",
    434434                   getuid(),pwd?pwd->pw_name:"",
    435435                   getgid(),grp?grp->gr_name:"");
    436436   pwd=getpwuid(geteuid());
    437437   grp=getgrgid(getegid());
    438    printf("euid=%d(%s),egid=%d(%s)\n",
     438   fprintf(stdout,"euid=%d(%s),egid=%d(%s)\n",
    439439                   geteuid(),pwd?pwd->pw_name:"",
    440440                   getegid(),grp?grp->gr_name:"");
     
    448448   umask(msk);
    449449   msk=umask(0);
    450    printf("0%o\n", (unsigned int) msk);
     450   fprintf(stdout,"0%o\n", (unsigned int) msk);
    451451   umask(msk);
    452452   return 0;
  • cpukit/libmisc/shell/shell.c

    r0fdc099 r714f06c  
    181181  char * pc;
    182182  int    col,line;
    183   printf("%-10.10s -",shell_cmd->name);
     183  fprintf(stdout,"%-10.10s -",shell_cmd->name);
    184184  col=12;
    185185  line=1;
    186186  if (shell_cmd->alias) {
    187    printf("is an <alias> for command '%s'",shell_cmd->alias->name);
     187   fprintf(stdout,"is an <alias> for command '%s'",shell_cmd->alias->name);
    188188  } else
    189189  if (shell_cmd->usage) {
     
    207207    };
    208208    if (!col && *pc) {
    209       printf("            ");
     209      fprintf(stdout,"            ");
    210210      col=12;line++;
    211211    };
     
    225225  shell_cmd_t * shell_cmd=shell_first_cmd;
    226226  if (argc<2) {
    227    printf("help: ('r' repeat last cmd - 'e' edit last cmd)\n"
     227   fprintf(stdout,"help: ('r' repeat last cmd - 'e' edit last cmd)\n"
    228228          "  TOPIC? The topics are\n");
    229229   topic=shell_first_topic;
     
    231231   while (topic) {
    232232    if (!col){
    233      col=printf("   %s",topic->topic);
     233     col=fprintf(stdout,"   %s",topic->topic);
    234234    } else {
    235235     if ((col+strlen(topic->topic)+2)>78){
    236       printf("\n");
    237       col=printf("   %s",topic->topic);
     236      fprintf(stdout,"\n");
     237      col=fprintf(stdout,"   %s",topic->topic);
    238238     } else {
    239       col+=printf(", %s",topic->topic);
     239      col+=fprintf(stdout,", %s",topic->topic);
    240240     };
    241241    };
    242242    topic=topic->next;
    243243   };
    244    printf("\n");
     244   fprintf(stdout,"\n");
    245245   return 1;
    246246  };
     
    248248  for (arg=1;arg<argc;arg++) {
    249249   if (line>16) {
    250     printf("Press any key to continue...");getchar();
    251     printf("\n");
     250    fprintf(stdout,"Press any key to continue...");getchar();
     251    fprintf(stdout,"\n");
    252252    line=0;
    253253   };
     
    255255   if (!topic){
    256256    if ((shell_cmd=shell_lookup_cmd(argv[arg]))==NULL) {
    257      printf("help: topic or cmd '%s' not found. Try <help> alone for a list\n",argv[arg]);
     257     fprintf(stdout,"help: topic or cmd '%s' not found. Try <help> alone for a list\n",argv[arg]);
    258258     line++;
    259259    } else {
     
    262262    continue;
    263263   };
    264    printf("help: list for the topic '%s'\n",argv[arg]);
     264   fprintf(stdout,"help: list for the topic '%s'\n",argv[arg]);
    265265   line++;
    266266   while (shell_cmd) {
     
    268268     line+=shell_help_cmd(shell_cmd);
    269269    if (line>16) {
    270      printf("Press any key to continue...");getchar();
    271      printf("\n");
     270     fprintf(stdout,"Press any key to continue...");getchar();
     271     fprintf(stdout,"\n");
    272272     line=0;
    273273    };
     
    570570   stderr=fopen(devname,"r+");
    571571   if (!stderr) {
    572     printf("shell:unable to open stderr.%s:%s\n",devname,strerror(errno));
     572    fprintf(stdout,"shell:unable to open stderr.%s:%s\n",devname,strerror(errno));
    573573   };
    574574   /* when the future user environment runs ok
     
    589589   strcpy(last_cmd,"");
    590590   strcpy(cmd,"");
    591    printf("\n"
     591   fprintf(stdout,"\n"
    592592          "RTEMS SHELL (Ver.1.0-FRC):%s. "__DATE__". 'help' to list commands.\n",devname);
    593593   chdir("/"); /* XXX: chdir to getpwent homedir */
     
    597597    /* XXX: show_prompt user adjustable */
    598598    getcwd(curdir,sizeof(curdir));
    599     printf("%s [%s] %c ",shell_env->taskname,curdir,geteuid()?'$':'#');
     599    fprintf(stdout,"%s [%s] %c ",shell_env->taskname,curdir,geteuid()?'$':'#');
    600600    /* getcmd section */
    601601    if (!shell_scanline(cmd,sizeof(cmd),stdin,stdout)) break; /*EOF*/
     
    622622      shell_env->errorlevel=shell_cmd->command(argc,argv);
    623623     } else {
    624       printf("shell:%s command not found\n",argv[0]);
     624      fprintf(stdout,"shell:%s command not found\n",argv[0]);
    625625      shell_env->errorlevel=-1;
    626626     };
     
    630630    cmd[0]=0;
    631631   };
    632    printf("\nGoodbye from RTEMS SHELL :-(\n");
     632   fprintf(stdout,"\nGoodbye from RTEMS SHELL :-(\n");
    633633  };
    634634  } while (shell_env->forever);
  • cpukit/libmisc/shell/shell.h

    r0fdc099 r714f06c  
    1717#define __SHELL_H__
    1818
     19#include <rtems.h>
     20#include <stdio.h>
     21#include <termios.h>
     22
    1923#ifdef __cplusplus
    2024extern "C" {
    2125#endif
    22 
    23 #include <rtems.h>
    24 #include <stdio.h>
    25 #include <termios.h>
    2626
    2727typedef int (*shell_command_t)(int argc,char * argv[]);
  • cpukit/libmisc/stackchk/check.c

    r0fdc099 r714f06c  
    481481  }
    482482
    483   printf( "0x%08x  %4s  0x%08x  0x%08x   %8d   %8d\n",
     483  fprintf(stdout, "0x%08x  %4s  0x%08x  0x%08x   %8d   %8d\n",
    484484          the_thread ? the_thread->Object.id : ~0,
    485485          name,
     
    525525      return;
    526526
    527   printf("Stack usage by thread\n");
    528   printf(
     527  fprintf(stdout,"Stack usage by thread\n");
     528  fprintf(stdout,
    529529    "    ID      NAME       LOW        HIGH     AVAILABLE      USED\n"
    530530  );
  • cpukit/libmisc/untar/untar.c

    r0fdc099 r714f06c  
    205205         if ((fp = fopen(fname, "w")) == NULL)
    206206         {
    207             printf("Untar failed to create file %s\n", fname);
     207            fprintf(stdout,"Untar failed to create file %s\n", fname);
    208208            ptr += 512 * nblocks;
    209209         }
     
    223223               if (n != len)
    224224               {
    225                   printf("Error during write\n");
     225                  fprintf(stdout,"Error during write\n");
    226226                  break;
    227227               }
Note: See TracChangeset for help on using the changeset viewer.