summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-04-17 08:12:02 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-04-17 08:12:02 +0000
commit714f06c7fa0520bed36fa2a1b9e29986d1184ed0 (patch)
treeb37bd23e64e7055c805208c7d49efc01a3e94511 /cpukit
parentRemove stray white spaces. (diff)
downloadrtems-714f06c7fa0520bed36fa2a1b9e29986d1184ed0.tar.bz2
2004-04-17 Ralf Corsepius <ralf_corsepius@rtems.org>
* 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.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog15
-rw-r--r--cpukit/libmisc/capture/capture-cli.c210
-rw-r--r--cpukit/libmisc/cpuuse/cpuuse.c14
-rw-r--r--cpukit/libmisc/dumpbuf/dumpbuf.c2
-rw-r--r--cpukit/libmisc/fsmount/fsmount.c6
-rw-r--r--cpukit/libmisc/monitor/mon-command.c40
-rw-r--r--cpukit/libmisc/monitor/mon-config.c16
-rw-r--r--cpukit/libmisc/monitor/mon-dname.c8
-rw-r--r--cpukit/libmisc/monitor/mon-driver.c22
-rw-r--r--cpukit/libmisc/monitor/mon-extension.c26
-rw-r--r--cpukit/libmisc/monitor/mon-itask.c8
-rw-r--r--cpukit/libmisc/monitor/mon-monitor.c12
-rw-r--r--cpukit/libmisc/monitor/mon-mpci.c24
-rw-r--r--cpukit/libmisc/monitor/mon-object.c4
-rw-r--r--cpukit/libmisc/monitor/mon-prmisc.c32
-rw-r--r--cpukit/libmisc/monitor/mon-queue.c4
-rw-r--r--cpukit/libmisc/monitor/mon-symbols.c12
-rw-r--r--cpukit/libmisc/monitor/mon-task.c4
-rw-r--r--cpukit/libmisc/rtmonuse/rtmonuse.c8
-rw-r--r--cpukit/libmisc/shell/cmds.c62
-rw-r--r--cpukit/libmisc/shell/shell.c40
-rw-r--r--cpukit/libmisc/shell/shell.h8
-rw-r--r--cpukit/libmisc/stackchk/check.c6
-rw-r--r--cpukit/libmisc/untar/untar.c4
24 files changed, 301 insertions, 286 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 700aa97d3f..d54f50e7fa 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,18 @@
+2004-04-17 Ralf Corsepius <ralf_corsepius@rtems.org>
+
+ * 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.
+
2004-04-14 Ralf Corsepius <ralf_corsepius@rtems.org>
* sapi/include/rtems/sptables.h: Remove _RTEMS_version.
diff --git a/cpukit/libmisc/capture/capture-cli.c b/cpukit/libmisc/capture/capture-cli.c
index d61868b196..ca5041d768 100644
--- a/cpukit/libmisc/capture/capture-cli.c
+++ b/cpukit/libmisc/capture/capture-cli.c
@@ -75,7 +75,7 @@ rtems_capture_cli_open (
if (argc <= 1)
{
- printf (open_usage);
+ fprintf(stdout,open_usage);
return;
}
@@ -86,7 +86,7 @@ rtems_capture_cli_open (
if (argv[arg][1] == 'i')
enable = 1;
else
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -94,7 +94,7 @@ rtems_capture_cli_open (
if (size < 100)
{
- printf ("error: size must be greater than or equal to 100\n");
+ fprintf(stdout,"error: size must be greater than or equal to 100\n");
return;
}
}
@@ -104,11 +104,11 @@ rtems_capture_cli_open (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: open failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: open failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("capture engine opened.\n");
+ fprintf(stdout,"capture engine opened.\n");
if (!enable)
return;
@@ -117,11 +117,11 @@ rtems_capture_cli_open (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: open enable failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: open enable failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("capture engine enabled.\n");
+ fprintf(stdout,"capture engine enabled.\n");
}
/*
@@ -146,11 +146,11 @@ rtems_capture_cli_close (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: close failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: close failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("capture engine closed.\n");
+ fprintf(stdout,"capture engine closed.\n");
}
/*
@@ -175,11 +175,11 @@ rtems_capture_cli_enable (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: enable failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: enable failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("capture engine enabled.\n");
+ fprintf(stdout,"capture engine enabled.\n");
}
/*
@@ -204,11 +204,11 @@ rtems_capture_cli_disable (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: disable failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: disable failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("capture engine disabled.\n");
+ fprintf(stdout,"capture engine disabled.\n");
}
/*
@@ -245,7 +245,7 @@ rtems_capture_cli_task_list (
total_time = (ticks * rtems_capture_task_time (task)) + tick_offset;
- printf ("total %i\n", count);
+ fprintf(stdout,"total %i\n", count);
while (task)
{
@@ -266,32 +266,32 @@ rtems_capture_cli_task_list (
priority = rtems_capture_task_real_priority (task);
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_id (rtems_capture_task_id (task));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_name (rtems_capture_task_name (task));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_priority (rtems_capture_task_start_priority (task));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_priority (rtems_capture_task_real_priority (task));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_priority (rtems_capture_task_curr_priority (task));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_state (rtems_capture_task_state (task));
- printf (" %c%c%c%c%c",
+ fprintf(stdout," %c%c%c%c%c",
rtems_capture_task_valid (task) ? 'a' : 'd',
rtems_capture_task_flags (task) & RTEMS_CAPTURE_TRACED ? 't' : '-',
rtems_capture_task_control_flags (task) & RTEMS_CAPTURE_TO_ANY ? 'F' : '-',
rtems_capture_task_control_flags (task) & RTEMS_CAPTURE_FROM_ANY ? 'T' : '-',
rtems_capture_task_control_flags (task) & RTEMS_CAPTURE_FROM_TO ? 'E' : '-');
if ((floor > ceiling) && (ceiling > priority))
- printf ("--");
+ fprintf(stdout,"--");
else
- printf ("%c%c",
+ fprintf(stdout,"%c%c",
rtems_capture_task_control (task) ?
(rtems_capture_task_control_flags (task) & RTEMS_CAPTURE_WATCH ? 'w' : '+') : '-',
rtems_capture_watch_global_on () ? 'g' : '-');
- printf (" %3i%% %3i%% (%i)\n",
+ fprintf(stdout," %3i%% %3i%% (%i)\n",
stack_used, time_used, rtems_capture_task_ticks (task));
task = rtems_capture_next_task (task);
@@ -314,8 +314,8 @@ rtems_capture_cli_task_load_thread (rtems_task_argument arg)
rtems_task_priority floor = rtems_capture_watch_get_floor ();
int last_count = 0;
- printf ("\x1b[2J Press ENTER to exit.\n\n");
- printf (" PID NAME RPRI CPRI STATE %%CPU %%STK FLGS EXEC TIME\n");
+ fprintf(stdout,"\x1b[2J Press ENTER to exit.\n\n");
+ fprintf(stdout," PID NAME RPRI CPRI STATE %%CPU %%STK FLGS EXEC TIME\n");
for (;;)
{
@@ -370,7 +370,7 @@ rtems_capture_cli_task_load_thread (rtems_task_argument arg)
task = rtems_capture_next_task (task);
}
- printf ("\x1b[4;0H");
+ fprintf(stdout,"\x1b[4;0H");
total_time = 0;
@@ -404,38 +404,38 @@ rtems_capture_cli_task_load_thread (rtems_task_argument arg)
priority = rtems_capture_task_real_priority (tasks[i]);
- printf ("\x1b[K");
+ fprintf(stdout,"\x1b[K");
rtems_monitor_dump_id (rtems_capture_task_id (tasks[i]));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_name (rtems_capture_task_name (tasks[i]));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_priority (priority);
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_priority (rtems_capture_task_curr_priority (tasks[i]));
- printf (" ");
+ fprintf(stdout," ");
k = rtems_monitor_dump_state (rtems_capture_task_state (tasks[i]));
- printf ("%*c %3i.%03i%% ", 6 - k, ' ', task_load / 1000, task_load % 1000);
- printf ("%3i%% %c%c%c%c%c", stack_used,
+ fprintf(stdout,"%*c %3i.%03i%% ", 6 - k, ' ', task_load / 1000, task_load % 1000);
+ fprintf(stdout,"%3i%% %c%c%c%c%c", stack_used,
rtems_capture_task_valid (tasks[i]) ? 'a' : 'd',
rtems_capture_task_flags (tasks[i]) & RTEMS_CAPTURE_TRACED ? 't' : '-',
rtems_capture_task_control_flags (tasks[i]) & RTEMS_CAPTURE_TO_ANY ? 'F' : '-',
rtems_capture_task_control_flags (tasks[i]) & RTEMS_CAPTURE_FROM_ANY ? 'T' : '-',
rtems_capture_task_control_flags (tasks[i]) & RTEMS_CAPTURE_FROM_TO ? 'E' : '-');
if ((floor > ceiling) && (ceiling > priority))
- printf ("--");
+ fprintf(stdout,"--");
else
- printf ("%c%c",
+ fprintf(stdout,"%c%c",
rtems_capture_task_control (tasks[i]) ?
(rtems_capture_task_control_flags (tasks[i]) &
RTEMS_CAPTURE_WATCH ? 'w' : '+') : '-',
rtems_capture_watch_global_on () ? 'g' : '-');
- printf (" %qi\n", rtems_capture_task_time (tasks[i]));
+ fprintf(stdout," %qi\n", rtems_capture_task_time (tasks[i]));
}
while (j)
{
- printf ("\x1b[K\n");
+ fprintf(stdout,"\x1b[K\n");
j--;
}
@@ -472,7 +472,7 @@ rtems_capture_cli_task_load (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: cannot obtain the current priority: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: cannot obtain the current priority: %s\n", rtems_status_text (sc));
return;
}
@@ -485,7 +485,7 @@ rtems_capture_cli_task_load (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: cannot create helper thread: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: cannot create helper thread: %s\n", rtems_status_text (sc));
return;
}
@@ -493,7 +493,7 @@ rtems_capture_cli_task_load (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: cannot start helper thread: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: cannot start helper thread: %s\n", rtems_status_text (sc));
rtems_task_delete (id);
return;
}
@@ -511,7 +511,7 @@ rtems_capture_cli_task_load (
rtems_task_delete (id);
- printf ("load monitoring stopped.\n");
+ fprintf(stdout,"load monitoring stopped.\n");
return;
}
@@ -538,11 +538,11 @@ rtems_capture_cli_watch_list (
rtems_task_priority ceiling = rtems_capture_watch_get_ceiling ();
rtems_task_priority floor = rtems_capture_watch_get_floor ();
- printf ("watch priority ceiling is %i\n", ceiling);
- printf ("watch priority floor is %i\n", floor);
- printf ("global watch is %s\n",
+ fprintf(stdout,"watch priority ceiling is %i\n", ceiling);
+ fprintf(stdout,"watch priority floor is %i\n", floor);
+ fprintf(stdout,"global watch is %s\n",
rtems_capture_watch_global_on () ? "enabled" : "disabled");
- printf ("total %d\n", rtems_capture_control_count ());
+ fprintf(stdout,"total %d\n", rtems_capture_control_count ());
while (control)
{
@@ -550,11 +550,11 @@ rtems_capture_cli_watch_list (
int fshowed;
int lf;
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_id (rtems_capture_control_id (control));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_name (rtems_capture_control_name (control));
- printf (" %c%c%c%c%c",
+ fprintf(stdout," %c%c%c%c%c",
rtems_capture_control_flags (control) & RTEMS_CAPTURE_WATCH ? 'w' : '-',
rtems_capture_watch_global_on () ? 'g' : '-',
rtems_capture_control_flags (control) & RTEMS_CAPTURE_TO_ANY ? 'F' : '-',
@@ -565,7 +565,7 @@ rtems_capture_cli_watch_list (
{
if (lf && ((fshowed % 16) == 0))
{
- printf ("\n");
+ fprintf(stdout,"\n");
lf = 0;
}
@@ -574,9 +574,9 @@ rtems_capture_cli_watch_list (
*/
if (rtems_capture_control_from_name (control, f))
{
- printf (" %2i:", f);
+ fprintf(stdout," %2i:", f);
rtems_monitor_dump_name (rtems_capture_control_from_name (control, f));
- printf ("/");
+ fprintf(stdout,"/");
rtems_monitor_dump_id (rtems_capture_control_from_id (control, f));
fshowed++;
lf = 1;
@@ -584,7 +584,7 @@ rtems_capture_cli_watch_list (
}
if (lf)
- printf ("\n");
+ fprintf(stdout,"\n");
control = rtems_capture_next_control (control);
}
@@ -612,7 +612,7 @@ rtems_capture_cli_get_name_id (char* arg,
if (*valid_name && *valid_id)
{
- printf ("error: too many arguments\n");
+ fprintf(stdout,"error: too many arguments\n");
return 0;
}
@@ -669,7 +669,7 @@ rtems_capture_cli_watch_add (
if (argc <= 1)
{
- printf (watch_add_usage);
+ fprintf(stdout,watch_add_usage);
return;
}
@@ -677,7 +677,7 @@ rtems_capture_cli_watch_add (
{
if (argv[arg][0] == '-')
{
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -688,7 +688,7 @@ rtems_capture_cli_watch_add (
if (!valid_name && !valid_id)
{
- printf("error: no valid name or task id located\n");
+ fprintf(stdout,"error: no valid name or task id located\n");
return;
}
@@ -696,11 +696,11 @@ rtems_capture_cli_watch_add (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: watch add failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: watch add failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("watch added.\n");
+ fprintf(stdout,"watch added.\n");
}
/*
@@ -731,7 +731,7 @@ rtems_capture_cli_watch_del (
if (argc <= 1)
{
- printf (watch_del_usage);
+ fprintf(stdout,watch_del_usage);
return;
}
@@ -739,7 +739,7 @@ rtems_capture_cli_watch_del (
{
if (argv[arg][0] == '-')
{
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -750,7 +750,7 @@ rtems_capture_cli_watch_del (
if (!valid_name && !valid_id)
{
- printf("error: no valid name or task id located\n");
+ fprintf(stdout,"error: no valid name or task id located\n");
return;
}
@@ -758,11 +758,11 @@ rtems_capture_cli_watch_del (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: watch delete failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: watch delete failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("watch delete.\n");
+ fprintf(stdout,"watch delete.\n");
}
/*
@@ -793,7 +793,7 @@ rtems_capture_cli_watch_control (
if (argc <= 2)
{
- printf (watch_control_usage);
+ fprintf(stdout,watch_control_usage);
return;
}
@@ -801,7 +801,7 @@ rtems_capture_cli_watch_control (
{
if (argv[arg][0] == '-')
{
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -816,7 +816,7 @@ rtems_capture_cli_watch_control (
if (!valid_name && !valid_id)
{
- printf("error: no valid name or task id located\n");
+ fprintf(stdout,"error: no valid name or task id located\n");
return;
}
@@ -824,11 +824,11 @@ rtems_capture_cli_watch_control (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: watch control failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: watch control failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("watch %s.\n", enable ? "enabled" : "disabled");
+ fprintf(stdout,"watch %s.\n", enable ? "enabled" : "disabled");
}
/*
@@ -855,7 +855,7 @@ rtems_capture_cli_watch_global (
if (argc <= 1)
{
- printf (watch_global_usage);
+ fprintf(stdout,watch_global_usage);
return;
}
@@ -863,7 +863,7 @@ rtems_capture_cli_watch_global (
{
if (argv[arg][0] == '-')
{
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -878,11 +878,11 @@ rtems_capture_cli_watch_global (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: global watch failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: global watch failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("global watch %s.\n", enable ? "enabled" : "disabled");
+ fprintf(stdout,"global watch %s.\n", enable ? "enabled" : "disabled");
}
/*
@@ -909,7 +909,7 @@ rtems_capture_cli_watch_ceiling (
if (argc <= 1)
{
- printf (watch_ceiling_usage);
+ fprintf(stdout,watch_ceiling_usage);
return;
}
@@ -917,7 +917,7 @@ rtems_capture_cli_watch_ceiling (
{
if (argv[arg][0] == '-')
{
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -929,11 +929,11 @@ rtems_capture_cli_watch_ceiling (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: watch ceiling failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: watch ceiling failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("watch ceiling is %i.\n", priority);
+ fprintf(stdout,"watch ceiling is %i.\n", priority);
}
/*
@@ -960,7 +960,7 @@ rtems_capture_cli_watch_floor (
if (argc <= 1)
{
- printf (watch_floor_usage);
+ fprintf(stdout,watch_floor_usage);
return;
}
@@ -968,7 +968,7 @@ rtems_capture_cli_watch_floor (
{
if (argv[arg][0] == '-')
{
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -980,11 +980,11 @@ rtems_capture_cli_watch_floor (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: watch floor failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: watch floor failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("watch floor is %i.\n", priority);
+ fprintf(stdout,"watch floor is %i.\n", priority);
}
/*
@@ -1024,7 +1024,7 @@ rtems_capture_cli_trigger_set (
if (argc <= 2)
{
- printf (trigger_set_usage);
+ fprintf(stdout,trigger_set_usage);
return;
}
@@ -1032,7 +1032,7 @@ rtems_capture_cli_trigger_set (
{
if (argv[arg][0] == '-')
{
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
else
{
@@ -1046,7 +1046,7 @@ rtems_capture_cli_trigger_set (
trigger = rtems_capture_from_any;
else
{
- printf ("error: the first argument is the trigger type (from/to/edge)\n");
+ fprintf(stdout,"error: the first argument is the trigger type (from/to/edge)\n");
return;
}
trigger_set = 1;
@@ -1056,7 +1056,7 @@ rtems_capture_cli_trigger_set (
if (trigger == rtems_capture_to_any)
{
if (from_valid_name && from_valid_id)
- printf ("warning: extra arguments ignored\n");
+ fprintf(stdout,"warning: extra arguments ignored\n");
else if (!rtems_capture_cli_get_name_id (argv[arg], &from_valid_name, &from_valid_id,
&from_name, &from_id))
return;
@@ -1064,7 +1064,7 @@ rtems_capture_cli_trigger_set (
else if (trigger == rtems_capture_from_any)
{
if (to_valid_name && to_valid_id)
- printf ("warning: extra arguments ignored\n");
+ fprintf(stdout,"warning: extra arguments ignored\n");
else if (!rtems_capture_cli_get_name_id (argv[arg], &to_valid_name, &to_valid_id,
&to_name, &to_id))
return;
@@ -1072,7 +1072,7 @@ rtems_capture_cli_trigger_set (
else if (trigger == rtems_capture_from_to)
{
if (from_valid_name && from_valid_id && to_valid_name && to_valid_id)
- printf ("warning: extra arguments ignored\n");
+ fprintf(stdout,"warning: extra arguments ignored\n");
else
{
if (!rtems_capture_cli_get_name_id (argv[arg], &valid_name, &valid_id,
@@ -1087,7 +1087,7 @@ rtems_capture_cli_trigger_set (
from_name = name;
}
else if (to_valid_name)
- printf ("warning: extra arguments ignored\n");
+ fprintf(stdout,"warning: extra arguments ignored\n");
else
{
to_valid_name = 1;
@@ -1102,7 +1102,7 @@ rtems_capture_cli_trigger_set (
from_id = id;
}
else if (to_valid_id)
- printf ("warning: extra arguments ignored\n");
+ fprintf(stdout,"warning: extra arguments ignored\n");
else
{
to_valid_id = 1;
@@ -1117,20 +1117,20 @@ rtems_capture_cli_trigger_set (
if ((trigger == rtems_capture_to_any) && !from_valid_name && !from_valid_id)
{
- printf ("error: a from trigger need a to name or id\n");
+ fprintf(stdout,"error: a from trigger need a to name or id\n");
return;
}
if ((trigger == rtems_capture_from_any) && !to_valid_name && !to_valid_id)
{
- printf ("error: a to trigger need a from name or id\n");
+ fprintf(stdout,"error: a to trigger need a from name or id\n");
return;
}
if ((trigger == rtems_capture_from_to) &&
((!from_valid_name && !from_valid_id) || (!to_valid_name && !to_valid_id)))
{
- printf ("error: an edge trigger need a from and to name or id\n");
+ fprintf(stdout,"error: an edge trigger need a from and to name or id\n");
return;
}
@@ -1138,11 +1138,11 @@ rtems_capture_cli_trigger_set (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: setting the trigger failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: setting the trigger failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("trigger set.\n");
+ fprintf(stdout,"trigger set.\n");
}
/*
@@ -1184,7 +1184,7 @@ rtems_capture_cli_trace_records (
arg++;
if (arg == argc)
{
- printf ("error: option -r requires number\n");
+ fprintf(stdout,"error: option -r requires number\n");
return;
}
@@ -1193,14 +1193,14 @@ rtems_capture_cli_trace_records (
for (i = 0; i < l; i++)
if (!isdigit (argv[arg][i]))
{
- printf ("error: option -r requires number and currently it is not\n");
+ fprintf(stdout,"error: option -r requires number and currently it is not\n");
return;
}
dump_total = strtoul (argv[arg], 0, 0);
}
else
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
}
@@ -1212,7 +1212,7 @@ rtems_capture_cli_trace_records (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: trace read failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: trace read failed: %s\n", rtems_status_text (sc));
rtems_capture_flush (0);
return;
}
@@ -1223,7 +1223,7 @@ rtems_capture_cli_trace_records (
for (count = 0; count < read; count++, rec++)
{
if (csv)
- printf ("%08x,%03d,%03d,%04x,%d,%d\n",
+ fprintf(stdout,"%08x,%03d,%03d,%04x,%d,%d\n",
(uint32_t ) rec->task,
(rec->events >> RTEMS_CAPTURE_REAL_PRIORITY_EVENT) & 0xff,
(rec->events >> RTEMS_CAPTURE_CURR_PRIORITY_EVENT) & 0xff,
@@ -1245,12 +1245,12 @@ rtems_capture_cli_trace_records (
{
if (event & 1)
{
- printf ("%9li.%06li ", (unsigned long) (t / 1000000),
+ fprintf(stdout,"%9li.%06li ", (unsigned long) (t / 1000000),
(unsigned long) (t % 1000000));
rtems_monitor_dump_id (rtems_capture_task_id (rec->task));
- printf (" ");
+ fprintf(stdout," ");
rtems_monitor_dump_name (rtems_capture_task_name (rec->task));
- printf (" %3i %3i %s\n",
+ fprintf(stdout," %3i %3i %s\n",
(rec->events >> RTEMS_CAPTURE_REAL_PRIORITY_EVENT) & 0xff,
(rec->events >> RTEMS_CAPTURE_CURR_PRIORITY_EVENT) & 0xff,
rtems_capture_event_text (e));
@@ -1297,7 +1297,7 @@ rtems_capture_cli_flush (
if (argv[arg][1] == 'n')
prime = 0;
else
- printf ("warning: option -%c ignored\n", argv[arg][1]);
+ fprintf(stdout,"warning: option -%c ignored\n", argv[arg][1]);
}
}
@@ -1305,11 +1305,11 @@ rtems_capture_cli_flush (
if (sc != RTEMS_SUCCESSFUL)
{
- printf ("error: flush failed: %s\n", rtems_status_text (sc));
+ fprintf(stdout,"error: flush failed: %s\n", rtems_status_text (sc));
return;
}
- printf ("trace buffer flushed and %s.\n", prime ? "primed" : "not primed");
+ fprintf(stdout,"trace buffer flushed and %s.\n", prime ? "primed" : "not primed");
}
static rtems_monitor_command_entry_t rtems_capture_cli_cmds[] =
diff --git a/cpukit/libmisc/cpuuse/cpuuse.c b/cpukit/libmisc/cpuuse/cpuuse.c
index d546bf8ae1..189b542644 100644
--- a/cpukit/libmisc/cpuuse/cpuuse.c
+++ b/cpukit/libmisc/cpuuse/cpuuse.c
@@ -60,11 +60,11 @@ void CPU_usage_Dump( void )
}
}
- printf("CPU Usage by thread\n");
+ fprintf(stdout,"CPU Usage by thread\n");
#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( " ID NAME TICKS PERCENT\n" );
+ fprintf(stdout, " ID NAME TICKS PERCENT\n" );
#else
- printf( " ID NAME TICKS\n" );
+ fprintf(stdout, " ID NAME TICKS\n" );
#endif
for ( api_index = 1 ;
@@ -102,7 +102,7 @@ void CPU_usage_Dump( void )
if ( !isprint(name[3]) ) name[3] = '*';
#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
- printf( "0x%08x %4s %8d %5.3f\n",
+ fprintf(stdout, "0x%08x %4s %8d %5.3f\n",
the_thread->Object.id,
name,
the_thread->ticks_executed,
@@ -111,7 +111,7 @@ void CPU_usage_Dump( void )
(double)total_units
);
#else
- printf( "0x%08x %4s %8d\n",
+ fprintf(stdout, "0x%08x %4s %8d\n",
the_thread->Object.id,
name,
the_thread->ticks_executed
@@ -121,11 +121,11 @@ void CPU_usage_Dump( void )
}
}
- printf(
+ fprintf(stdout,
"\nTicks since last reset = %d\n",
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
);
- printf( "\nTotal Units = %d\n", total_units );
+ fprintf(stdout, "\nTotal Units = %d\n", total_units );
}
/*PAGE
diff --git a/cpukit/libmisc/dumpbuf/dumpbuf.c b/cpukit/libmisc/dumpbuf/dumpbuf.c
index b83a23f0bd..120a464a90 100644
--- a/cpukit/libmisc/dumpbuf/dumpbuf.c
+++ b/cpukit/libmisc/dumpbuf/dumpbuf.c
@@ -75,5 +75,5 @@ static inline void Dump_Line(
strcat( line_buffer, "|\n" );
- printf( line_buffer );
+ fprintf(stdout, line_buffer );
}
diff --git a/cpukit/libmisc/fsmount/fsmount.c b/cpukit/libmisc/fsmount/fsmount.c
index 1eafe68d8f..0d5e388f62 100644
--- a/cpukit/libmisc/fsmount/fsmount.c
+++ b/cpukit/libmisc/fsmount/fsmount.c
@@ -136,7 +136,7 @@ int rtems_fsmount
tmp_rc = rtems_fsmount_create_mountpoint(fstab_ptr->mount_point);
if (tmp_rc != 0) {
if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNTPNT_CRTERR)) {
- printf("fsmount: creation of mount point \"%s\" failed: %s\n",
+ fprintf(stdout,"fsmount: creation of mount point \"%s\" failed: %s\n",
fstab_ptr->mount_point,
strerror(errno));
}
@@ -157,7 +157,7 @@ int rtems_fsmount
fstab_ptr->mount_point);
if (tmp_rc != RTEMS_SUCCESSFUL) {
if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_FAILED)) {
- printf("fsmount: mounting of \"%s\" to"
+ fprintf(stdout,"fsmount: mounting of \"%s\" to"
" \"%s\" failed: %s\n",
fstab_ptr->dev,
fstab_ptr->mount_point,
@@ -170,7 +170,7 @@ int rtems_fsmount
}
else {
if (0 != (fstab_ptr->report_reasons & FSMOUNT_MNT_OK)) {
- printf("fsmount: mounting of \"%s\" to"
+ fprintf(stdout,"fsmount: mounting of \"%s\" to"
" \"%s\" succeeded\n",
fstab_ptr->dev,
fstab_ptr->mount_point);
diff --git a/cpukit/libmisc/monitor/mon-command.c b/cpukit/libmisc/monitor/mon-command.c
index 1c65e0208e..dc20dcb203 100644
--- a/cpukit/libmisc/monitor/mon-command.c
+++ b/cpukit/libmisc/monitor/mon-command.c
@@ -235,9 +235,9 @@ rtems_monitor_line_editor (
pos = 0;
if (!logged_in)
- printf ("\nMonitor ready, press enter to login.\n\n");
+ fprintf(stdout,"\nMonitor ready, press enter to login.\n\n");
else
- printf ("%s $ ", monitor_prompt);
+ fprintf(stdout,"%s $ ", monitor_prompt);
while (1)
{
@@ -258,7 +258,7 @@ rtems_monitor_line_editor (
* The prompt has changed from `>' to `$' to help know
* which version of the monitor code people are using.
*/
- printf("%s $ ", monitor_prompt);
+ fprintf(stdout,"%s $ ", monitor_prompt);
}
}
else
@@ -268,12 +268,12 @@ rtems_monitor_line_editor (
switch (c)
{
case KEYS_END:
- printf (buffer + pos);
+ fprintf(stdout,buffer + pos);
pos = (int) strlen (buffer);
break;
case KEYS_HOME:
- printf ("\r%s $ ", monitor_prompt);
+ fprintf(stdout,"\r%s $ ", monitor_prompt);
pos = 0;
break;
@@ -312,8 +312,8 @@ rtems_monitor_line_editor (
memcpy (buffer, history_buffer[history],
RTEMS_COMMAND_BUFFER_SIZE);
pos = history_pos[history];
- printf ("\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
- printf ("\r%s $ %s", monitor_prompt, buffer);
+ fprintf(stdout,"\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
+ fprintf(stdout,"\r%s $ %s", monitor_prompt, buffer);
end = (int) strlen (buffer);
for (bs = 0; bs < (end - pos); bs++)
putchar ('\b');
@@ -329,8 +329,8 @@ rtems_monitor_line_editor (
memcpy (buffer, history_buffer[history],
RTEMS_COMMAND_BUFFER_SIZE);
pos = history_pos[history];
- printf ("\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
- printf ("\r%s $ %s", monitor_prompt, buffer);
+ fprintf(stdout,"\r%*c", RTEMS_COMMAND_BUFFER_SIZE, ' ');
+ fprintf(stdout,"\r%s $ %s", monitor_prompt, buffer);
end = (int) strlen (buffer);
for (bs = 0; bs < (end - pos); bs++)
putchar ('\b');
@@ -343,7 +343,7 @@ rtems_monitor_line_editor (
int end;
int bs;
strcpy (&buffer[pos], &buffer[pos + 1]);
- printf ("\r%s $ %s", monitor_prompt, buffer);
+ fprintf(stdout,"\r%s $ %s", monitor_prompt, buffer);
end = (int) strlen (buffer);
for (bs = 0; bs < (end - pos); bs++)
putchar ('\b');
@@ -363,7 +363,7 @@ rtems_monitor_line_editor (
int bs;
pos--;
strcpy (buffer + pos, buffer + pos + 1);
- printf ("\b%s \b", buffer + pos);
+ fprintf(stdout,"\b%s \b", buffer + pos);
for (bs = 0; bs < ((int) strlen (buffer) - pos); bs++)
putchar ('\b');
}
@@ -373,7 +373,7 @@ rtems_monitor_line_editor (
/*
* Process the command.
*/
- printf ("\n");
+ fprintf(stdout,"\n");
repeating = 1;
/*
* Only process the history if we have a command and
@@ -431,7 +431,7 @@ rtems_monitor_line_editor (
int ch, bs;
for (ch = end + 1; ch > pos; ch--)
buffer[ch] = buffer[ch - 1];
- printf (buffer + pos);
+ fprintf(stdout,buffer + pos);
for (bs = 0; bs < (end - pos + 1); bs++)
putchar ('\b');
}
@@ -505,7 +505,7 @@ rtems_monitor_command_read(char *command,
#if defined(RTEMS_UNIX)
/* RTEMS on unix gets so many interrupt system calls this is hosed */
- printf ("%s> ", monitor_prompt);
+ fprintf(stdout,"%s> ", monitor_prompt);
fflush (stdout);
while (gets(command) == (char *) 0)
;
@@ -589,20 +589,20 @@ rtems_monitor_show_help (
int line_one = 1;
int c;
- printf ("%s", help_cmd->command);
+ fprintf(stdout,"%s", help_cmd->command);
if (help_len == 0)
{
- printf (" - No help associated.\n");
+ fprintf(stdout," - No help associated.\n");
return;
}
while (help_len)
{
- printf ("%*c", spaces, ' ');
+ fprintf(stdout,"%*c", spaces, ' ');
if (line_one)
- printf (" - ");
+ fprintf(stdout," - ");
spaces = max_cmd_len + 2;
line_one = 0;
@@ -638,7 +638,7 @@ rtems_monitor_show_help (
else
putchar (help[c]);
- printf ("\n");
+ fprintf(stdout,"\n");
help += show_this_line;
help_len -= show_this_line;
@@ -688,7 +688,7 @@ rtems_monitor_command_usage(
if (command)
rtems_monitor_show_help (command, strlen (command_string));
else
- printf ("Unrecognised command; try just 'help'\n");
+ fprintf(stdout,"Unrecognised command; try just 'help'\n");
return;
}
diff --git a/cpukit/libmisc/monitor/mon-config.c b/cpukit/libmisc/monitor/mon-config.c
index 52a6af3836..0928eca7e1 100644
--- a/cpukit/libmisc/monitor/mon-config.c
+++ b/cpukit/libmisc/monitor/mon-config.c
@@ -84,7 +84,7 @@ rtems_monitor_config_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
INITIAL (startup) Configuration Info\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
@@ -101,24 +101,24 @@ rtems_monitor_config_dump(
uint32_t length = 0;
length = 0;
- length += printf("WORKSPACE");
+ length += fprintf(stdout,"WORKSPACE");
length += rtems_monitor_pad(DATACOL, length);
- length += printf("start: %p; size: 0x%x\n",
+ length += fprintf(stdout,"start: %p; size: 0x%x\n",
monitor_config->work_space_start,
monitor_config->work_space_size);
length = 0;
- length += printf("TIME");
+ length += fprintf(stdout,"TIME");
length += rtems_monitor_pad(DATACOL, length);
- length += printf("usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n",
+ length += fprintf(stdout,"usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n",
monitor_config->microseconds_per_tick,
monitor_config->ticks_per_timeslice,
1000000 / monitor_config->microseconds_per_tick);
length = 0;
- length += printf("MAXIMUMS");
+ length += fprintf(stdout,"MAXIMUMS");
length += rtems_monitor_pad(DATACOL, length);
- length += printf("tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n",
+ length += fprintf(stdout,"tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n",
monitor_config->maximum_tasks,
monitor_config->maximum_timers,
monitor_config->maximum_semaphores,
@@ -126,7 +126,7 @@ rtems_monitor_config_dump(
monitor_config->maximum_extensions);
length = 0;
length += rtems_monitor_pad(CONTCOL, length);
- length += printf("partitions: %d; regions: %d; ports: %d; periods: %d\n",
+ length += fprintf(stdout,"partitions: %d; regions: %d; ports: %d; periods: %d\n",
monitor_config->maximum_partitions,
monitor_config->maximum_regions,
monitor_config->maximum_ports,
diff --git a/cpukit/libmisc/monitor/mon-dname.c b/cpukit/libmisc/monitor/mon-dname.c
index 5a110ecfc7..4f9cc1aef2 100644
--- a/cpukit/libmisc/monitor/mon-dname.c
+++ b/cpukit/libmisc/monitor/mon-dname.c
@@ -86,7 +86,7 @@ rtems_monitor_dname_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
Major:Minor Name\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
@@ -103,14 +103,14 @@ rtems_monitor_dname_dump(
length += rtems_monitor_pad(6, length);
length += rtems_monitor_dump_hex(monitor_dname->major);
- length += printf(":");
+ length += fprintf(stdout,":");
length += rtems_monitor_dump_hex(monitor_dname->minor);
length += rtems_monitor_pad(16, length);
- length += printf("%.*s",
+ length += fprintf(stdout,"%.*s",
(int) sizeof(monitor_dname->name_string),
(char *) monitor_dname->name_string);
- length += printf("\n");
+ length += fprintf(stdout,"\n");
length = 0;
}
diff --git a/cpukit/libmisc/monitor/mon-driver.c b/cpukit/libmisc/monitor/mon-driver.c
index f68b9183c2..12e84f414e 100644
--- a/cpukit/libmisc/monitor/mon-driver.c
+++ b/cpukit/libmisc/monitor/mon-driver.c
@@ -95,7 +95,7 @@ rtems_monitor_driver_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
Major Entry points\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
@@ -110,31 +110,31 @@ rtems_monitor_driver_dump(
{
uint32_t length = 0;
- length += printf(" %d", monitor_driver->id);
+ length += fprintf(stdout," %d", monitor_driver->id);
length += rtems_monitor_pad(13, length);
- length += printf("init: ");
+ length += fprintf(stdout,"init: ");
length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
- length += printf("; control: ");
+ length += fprintf(stdout,"; control: ");
length += rtems_monitor_symbol_dump(&monitor_driver->control, verbose);
- length += printf("\n");
+ length += fprintf(stdout,"\n");
length = 0;
length += rtems_monitor_pad(13, length);
- length += printf("open: ");
+ length += fprintf(stdout,"open: ");
length += rtems_monitor_symbol_dump(&monitor_driver->open, verbose);
- length += printf("; close: ");
+ length += fprintf(stdout,"; close: ");
length += rtems_monitor_symbol_dump(&monitor_driver->close, verbose);
- length += printf("\n");
+ length += fprintf(stdout,"\n");
length = 0;
length += rtems_monitor_pad(13, length);
- length += printf("read: ");
+ length += fprintf(stdout,"read: ");
length += rtems_monitor_symbol_dump(&monitor_driver->read, verbose);
- length += printf("; write: ");
+ length += fprintf(stdout,"; write: ");
length += rtems_monitor_symbol_dump(&monitor_driver->write, verbose);
- length += printf("\n");
+ length += fprintf(stdout,"\n");
length = 0;
}
diff --git a/cpukit/libmisc/monitor/mon-extension.c b/cpukit/libmisc/monitor/mon-extension.c
index ba8d92824b..900fee5b87 100644
--- a/cpukit/libmisc/monitor/mon-extension.c
+++ b/cpukit/libmisc/monitor/mon-extension.c
@@ -46,7 +46,7 @@ rtems_monitor_extension_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
ID NAME\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
@@ -72,31 +72,31 @@ rtems_monitor_extension_dump(
length += rtems_monitor_dump_name(monitor_extension->name);
length += rtems_monitor_pad(18, length);
- length += printf("create: ");
+ length += fprintf(stdout,"create: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
- length += printf("; start: ");
+ length += fprintf(stdout,"; start: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
- length += printf("; restart: ");
+ length += fprintf(stdout,"; restart: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
- length += printf("\n");
+ length += fprintf(stdout,"\n");
length = 0;
length += rtems_monitor_pad(18, length);
- length += printf("delete: ");
+ length += fprintf(stdout,"delete: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
- length += printf("; switch: ");
+ length += fprintf(stdout,"; switch: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
- length += printf("; begin: ");
+ length += fprintf(stdout,"; begin: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
- length += printf("\n");
+ length += fprintf(stdout,"\n");
length = 0;
length += rtems_monitor_pad(18, length);
- length += printf("exitted: ");
+ length += fprintf(stdout,"exitted: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
- length += printf("; fatal: ");
+ length += fprintf(stdout,"; fatal: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
- length += printf("\n");
+ length += fprintf(stdout,"\n");
length = 0;
- printf("\n");
+ fprintf(stdout,"\n");
}
diff --git a/cpukit/libmisc/monitor/mon-itask.c b/cpukit/libmisc/monitor/mon-itask.c
index 2c20866dfc..f83d0e8561 100644
--- a/cpukit/libmisc/monitor/mon-itask.c
+++ b/cpukit/libmisc/monitor/mon-itask.c
@@ -74,7 +74,7 @@ rtems_monitor_init_task_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
# NAME ENTRY ARGUMENT PRIO MODES ATTRIBUTES STACK SIZE\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
@@ -101,7 +101,7 @@ rtems_monitor_init_task_dump(
length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
length += rtems_monitor_pad(25, length);
- length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
+ length += fprintf(stdout,"%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
length += rtems_monitor_pad(39, length);
length += rtems_monitor_dump_priority(monitor_itask->priority);
@@ -113,7 +113,7 @@ rtems_monitor_init_task_dump(
length += rtems_monitor_dump_attributes(monitor_itask->attributes);
length += rtems_monitor_pad(66, length);
- length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
+ length += fprintf(stdout,"%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
- printf("\n");
+ fprintf(stdout,"\n");
}
diff --git a/cpukit/libmisc/monitor/mon-monitor.c b/cpukit/libmisc/monitor/mon-monitor.c
index 9411441fe0..d45df2dfc0 100644
--- a/cpukit/libmisc/monitor/mon-monitor.c
+++ b/cpukit/libmisc/monitor/mon-monitor.c
@@ -326,7 +326,7 @@ rtems_monitor_node_cmd(
break;
default:
- printf("invalid syntax, try 'help node'\n");
+ fprintf(stdout,"invalid syntax, try 'help node'\n");
break;
}
@@ -398,13 +398,13 @@ rtems_monitor_symbols_loadup(void)
(uint32_t ) strtoul(value, 0, 16));
if (sp == 0)
{
- printf("could not define symbol '%s'\n", symbol);
+ fprintf(stdout,"could not define symbol '%s'\n", symbol);
goto done;
}
}
else
{
- printf("parsing error on '%s'\n", buffer);
+ fprintf(stdout,"parsing error on '%s'\n", buffer);
goto done;
}
}
@@ -478,7 +478,7 @@ rtems_monitor_task(
if (tcgetattr (STDIN_FILENO, &term) < 0)
{
- printf("rtems-monitor: cannot get terminal attributes.\n");
+ fprintf(stdout,"rtems-monitor: cannot get terminal attributes.\n");
}
else
{
@@ -499,7 +499,7 @@ rtems_monitor_task(
if (tcsetattr (STDIN_FILENO, TCSANOW, &term) < 0)
{
- printf("cannot set terminal attributes\n");
+ fprintf(stdout,"cannot set terminal attributes\n");
}
}
@@ -526,7 +526,7 @@ rtems_monitor_task(
argv)) == 0)
{
/* no command */
- printf("Unrecognised command; try 'help'\n");
+ fprintf(stdout,"Unrecognised command; try 'help'\n");
continue;
}
diff --git a/cpukit/libmisc/monitor/mon-mpci.c b/cpukit/libmisc/monitor/mon-mpci.c
index 4c4d2e17cb..2cbd48eb3c 100644
--- a/cpukit/libmisc/monitor/mon-mpci.c
+++ b/cpukit/libmisc/monitor/mon-mpci.c
@@ -97,7 +97,7 @@ rtems_monitor_mpci_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
max max max default max\n\
node nodes globals proxies timeout pktsize\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
@@ -116,9 +116,9 @@ rtems_monitor_mpci_dump(
uint32_t length = 0;
length += rtems_monitor_pad(2, length);
- length += printf(" %d", monitor_mpci->node);
+ length += fprintf(stdout," %d", monitor_mpci->node);
length += rtems_monitor_pad(11, length);
- length += printf("%d", monitor_mpci->maximum_nodes);
+ length += fprintf(stdout,"%d", monitor_mpci->maximum_nodes);
length += rtems_monitor_pad(18, length);
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
@@ -132,31 +132,31 @@ rtems_monitor_mpci_dump(
length += rtems_monitor_pad(46, length);
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
- printf("\n");
+ fprintf(stdout,"\n");
length = 0;
length += rtems_monitor_pad(DATACOL, length);
- length += printf("init: ");
+ length += fprintf(stdout,"init: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
- printf("\n");
+ fprintf(stdout,"\n");
length = 0;
length += rtems_monitor_pad(DATACOL, length);
- length += printf("get: ");
+ length += fprintf(stdout,"get: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
- length += printf("; return: ");
+ length += fprintf(stdout,"; return: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
- printf("\n");
+ fprintf(stdout,"\n");
length = 0;
length += rtems_monitor_pad(DATACOL, length);
- length += printf("send: ");
+ length += fprintf(stdout,"send: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
- length += printf("; receive: ");
+ length += fprintf(stdout,"; receive: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
- printf("\n");
+ fprintf(stdout,"\n");
length = 0;
}
diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c
index fb24717340..4428234220 100644
--- a/cpukit/libmisc/monitor/mon-object.c
+++ b/cpukit/libmisc/monitor/mon-object.c
@@ -330,7 +330,7 @@ rtems_monitor_object_cmd(
{
if (type == RTEMS_MONITOR_OBJECT_INVALID)
{
- printf("A type must be specified to \"dump all\"\n");
+ fprintf(stdout,"A type must be specified to \"dump all\"\n");
goto done;
}
@@ -371,7 +371,7 @@ rtems_monitor_object_cmd(
if (info == 0)
{
-not_found: printf("Invalid or unsupported type %d\n", type);
+not_found: fprintf(stdout,"Invalid or unsupported type %d\n", type);
goto done;
}
diff --git a/cpukit/libmisc/monitor/mon-prmisc.c b/cpukit/libmisc/monitor/mon-prmisc.c
index bb7a48d098..5104962650 100644
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ b/cpukit/libmisc/monitor/mon-prmisc.c
@@ -22,7 +22,7 @@
void
rtems_monitor_separator(void)
{
- printf("------------------------------------------------------------------------------\n");
+ fprintf(stdout,"------------------------------------------------------------------------------\n");
}
uint32_t
@@ -38,28 +38,28 @@ rtems_monitor_pad(
else
pad_length = destination_column - current_column;
- return printf("%*s", pad_length, "");
+ return fprintf(stdout,"%*s", pad_length, "");
}
uint32_t
rtems_monitor_dump_char(uint8_t ch)
{
if (isprint(ch))
- return printf("%c", ch);
+ return fprintf(stdout,"%c", ch);
else
- return printf("%02x", ch);
+ return fprintf(stdout,"%02x", ch);
}
uint32_t
rtems_monitor_dump_decimal(uint32_t num)
{
- return printf("%4d", num);
+ return fprintf(stdout,"%4d", num);
}
uint32_t
rtems_monitor_dump_hex(uint32_t num)
{
- return printf("0x%x", num);
+ return fprintf(stdout,"0x%x", num);
}
uint32_t
@@ -77,14 +77,14 @@ rtems_monitor_dump_assoc_bitfield(
if (b & value)
{
if (length)
- length += printf("%s", separator);
+ length += fprintf(stdout,"%s", separator);
name = rtems_assoc_name_by_local(ap, b);
if (name)
- length += printf("%s", name);
+ length += fprintf(stdout,"%s", name);
else
- length += printf("0x%x", b);
+ length += fprintf(stdout,"0x%x", b);
}
return length;
@@ -93,7 +93,7 @@ rtems_monitor_dump_assoc_bitfield(
uint32_t
rtems_monitor_dump_id(rtems_id id)
{
- return printf("%08x", id);
+ return fprintf(stdout,"%08x", id);
}
uint32_t
@@ -121,7 +121,7 @@ rtems_monitor_dump_name(rtems_name name)
uint32_t
rtems_monitor_dump_priority(rtems_task_priority priority)
{
- return printf("%3d", priority);
+ return fprintf(stdout,"%3d", priority);
}
@@ -152,7 +152,7 @@ rtems_monitor_dump_state(States_Control state)
uint32_t length = 0;
if (state == STATES_READY) /* assoc doesn't deal with this as it is 0 */
- length += printf("READY");
+ length += fprintf(stdout,"READY");
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_state_assoc,
":",
@@ -175,7 +175,7 @@ rtems_monitor_dump_attributes(rtems_attribute attributes)
uint32_t length = 0;
if (attributes == RTEMS_DEFAULT_ATTRIBUTES) /* value is 0 */
- length += printf("DEFAULT");
+ length += fprintf(stdout,"DEFAULT");
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_attribute_assoc,
":",
@@ -196,7 +196,7 @@ rtems_monitor_dump_modes(rtems_mode modes)
uint32_t length = 0;
if (modes == RTEMS_DEFAULT_MODES) /* value is 0 */
- length += printf("P:T:nA");
+ length += fprintf(stdout,"P:T:nA");
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_modes_assoc,
":",
@@ -246,7 +246,7 @@ rtems_monitor_dump_events(rtems_event_set events)
uint32_t length = 0;
if (events == EVENT_SETS_NONE_PENDING) /* value is 0 */
- length += printf("NONE");
+ length += fprintf(stdout,"NONE");
length += rtems_monitor_dump_assoc_bitfield(rtems_monitor_events_assoc,
":",
@@ -262,7 +262,7 @@ rtems_monitor_dump_notepad(uint32_t *notepad)
for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
if (notepad[i])
- length += printf("%d: 0x%x ", i, notepad[i]);
+ length += fprintf(stdout,"%d: 0x%x ", i, notepad[i]);
return length;
}
diff --git a/cpukit/libmisc/monitor/mon-queue.c b/cpukit/libmisc/monitor/mon-queue.c
index 455f0cf376..1714808fd8 100644
--- a/cpukit/libmisc/monitor/mon-queue.c
+++ b/cpukit/libmisc/monitor/mon-queue.c
@@ -30,7 +30,7 @@ rtems_monitor_queue_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
@@ -64,5 +64,5 @@ rtems_monitor_queue_dump(
length += rtems_monitor_pad(48, length);
length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size);
- printf("\n");
+ fprintf(stdout,"\n");
}
diff --git a/cpukit/libmisc/monitor/mon-symbols.c b/cpukit/libmisc/monitor/mon-symbols.c
index 1dd8d20783..b83d0243e3 100644
--- a/cpukit/libmisc/monitor/mon-symbols.c
+++ b/cpukit/libmisc/monitor/mon-symbols.c
@@ -396,19 +396,19 @@ rtems_monitor_symbol_dump(
if (canonical_symbol->name[0] && (canonical_symbol->value != 0))
{
if (canonical_symbol->offset == 0)
- length += printf("%.*s",
+ length += fprintf(stdout,"%.*s",
(int) sizeof(canonical_symbol->name),
canonical_symbol->name);
else
- length += printf("<%.*s+0x%x>",
+ length += fprintf(stdout,"<%.*s+0x%x>",
(int) sizeof(canonical_symbol->name),
canonical_symbol->name,
canonical_symbol->offset);
if (verbose)
- length += printf(" [0x%x]", canonical_symbol->value);
+ length += fprintf(stdout," [0x%x]", canonical_symbol->value);
}
else
- length += printf("[0x%x]", canonical_symbol->value);
+ length += fprintf(stdout,"[0x%x]", canonical_symbol->value);
return length;
}
@@ -439,7 +439,7 @@ rtems_monitor_symbol_dump_all(
rtems_monitor_symbol_canonical(&canonical_symbol, sp);
rtems_monitor_symbol_dump(&canonical_symbol, TRUE);
- printf("\n");
+ fprintf(stdout,"\n");
}
}
@@ -480,7 +480,7 @@ rtems_monitor_symbol_cmd(
{
rtems_monitor_symbol_canonical_by_name(&canonical_symbol, argv[arg]);
rtems_monitor_symbol_dump(&canonical_symbol, verbose);
- printf("\n");
+ fprintf(stdout,"\n");
}
}
}
diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c
index 9c8e9d6de4..98e097dc71 100644
--- a/cpukit/libmisc/monitor/mon-task.c
+++ b/cpukit/libmisc/monitor/mon-task.c
@@ -52,7 +52,7 @@ rtems_monitor_task_dump_header(
boolean verbose
)
{
- printf("\
+ fprintf(stdout,"\
ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
@@ -92,5 +92,5 @@ rtems_monitor_task_dump(
length += rtems_monitor_pad(65, length);
length += rtems_monitor_dump_notepad(monitor_task->notepad);
- printf("\n");
+ fprintf(stdout,"\n");
}
diff --git a/cpukit/libmisc/rtmonuse/rtmonuse.c b/cpukit/libmisc/rtmonuse/rtmonuse.c
index db2223a6e4..14fca3b0eb 100644
--- a/cpukit/libmisc/rtmonuse/rtmonuse.c
+++ b/cpukit/libmisc/rtmonuse/rtmonuse.c
@@ -137,12 +137,12 @@ void Period_usage_Dump( void )
Objects_Information *information;
if ( !Period_usage_Information ) {
- printf( "Period statistics library is not initialized\n" );
+ fprintf(stdout, "Period statistics library is not initialized\n" );
return;
}
- printf( "Period information by period\n" );
- printf( " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n" );
+ fprintf(stdout, "Period information by period\n" );
+ fprintf(stdout, " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n" );
/*
* RTEMS does not use an index of zero for object ids.
@@ -191,7 +191,7 @@ void Period_usage_Dump( void )
if ( !isprint(name[3]) ) name[3] = '*';
- printf(
+ fprintf(stdout,
"0x%08x %4s %6d %3d %d/%d/%5.2f %d/%d/%3.2f\n",
the_usage->id,
name,
diff --git a/cpukit/libmisc/shell/cmds.c b/cpukit/libmisc/shell/cmds.c
index 50a086c0cf..ba3a4b030e 100644
--- a/cpukit/libmisc/shell/cmds.c
+++ b/cpukit/libmisc/shell/cmds.c
@@ -130,14 +130,14 @@ int main_mdump(int argc,char * argv[]) {
max/=16;
if (!max) max=20;
for (m=0;m<max;m++) {
- printf("0x%08X ",adr);
+ fprintf(stdout,"0x%08X ",adr);
pb=(unsigned char*) adr;
for (n=0;n<16;n++)
- printf("%02X%c",pb[n],n==7?'-':' ');
+ fprintf(stdout,"%02X%c",pb[n],n==7?'-':' ');
for (n=0;n<16;n++) {
- printf("%c",isprint(pb[n])?pb[n]:'.');
+ fprintf(stdout,"%c",isprint(pb[n])?pb[n]:'.');
};
- printf("\n");
+ fprintf(stdout,"\n");
adr+=16;
};
mdump_adr=adr;
@@ -153,15 +153,15 @@ int main_mwdump(int argc,char * argv[]) {
max/=16;
if (!max) max=20;
for (m=0;m<max;m++) {
- printf("0x%08X ",adr);
+ fprintf(stdout,"0x%08X ",adr);
pw=(unsigned short*) adr;
for (n=0;n<8;n++)
- printf("%02X %02X%c",pw[n]/0x100,pw[n]%0x100,n==3?'-':' ');
+ fprintf(stdout,"%02X %02X%c",pw[n]/0x100,pw[n]%0x100,n==3?'-':' ');
for (n=0;n<8;n++) {
- printf("%c",isprint(pw[n]/0x100)?pw[n]/0x100:'.');
- printf("%c",isprint(pw[n]%0x100)?pw[n]%0x100:'.');
+ fprintf(stdout,"%c",isprint(pw[n]/0x100)?pw[n]/0x100:'.');
+ fprintf(stdout,"%c",isprint(pw[n]%0x100)?pw[n]%0x100:'.');
};
- printf("\n");
+ fprintf(stdout,"\n");
adr+=16;
};
mdump_adr=adr;
@@ -172,7 +172,7 @@ int main_medit(int argc,char * argv[]) {
unsigned char * pb;
int n,i;
if (argc<3) {
- printf("too few arguments\n");
+ fprintf(stdout,"too few arguments\n");
return 0;
};
pb=(unsigned char*)str2int(argv[1]);
@@ -190,7 +190,7 @@ int main_mfill(int argc,char * argv[]) {
int size;
unsigned char value;
if (argc<4) {
- printf("too few arguments\n");
+ fprintf(stdout,"too few arguments\n");
return 0;
};
adr =str2int(argv[1]);
@@ -206,7 +206,7 @@ int main_mmove(int argc,char * argv[]) {
int dst;
int size;
if (argc<4) {
- printf("too few arguments\n");
+ fprintf(stdout,"too few arguments\n");
return 0;
};
dst =str2int(argv[1]);
@@ -230,7 +230,7 @@ int main_malloc_dump(int argc,char * argv[]) {
int main_reset (int argc, char **argv)
{
rtems_interrupt_level level;
- printf ("Waiting for watchdog ... ");
+ fprintf(stdout,"Waiting for watchdog ... ");
tcdrain(fileno(stdout));
rtems_interrupt_disable (level);
@@ -244,11 +244,11 @@ int main_reset (int argc, char **argv)
int main_alias (int argc, char **argv)
{
if (argc<3) {
- printf("too few arguments\n");
+ fprintf(stdout,"too few arguments\n");
return 1;
};
if (!shell_alias_cmd(argv[1],argv[2])) {
- printf("unable to make an alias(%s,%s)\n",argv[1],argv[2]);
+ fprintf(stdout,"unable to make an alias(%s,%s)\n",argv[1],argv[2]);
};
return 0;
}
@@ -274,7 +274,7 @@ int main_ls(int argc, char *argv[])
if ((dirp = opendir(fname)) == NULL)
{
- printf("%s: No such file or directory.\n", fname);
+ fprintf(stdout,"%s: No such file or directory.\n", fname);
return errno;
}
n=0;
@@ -291,7 +291,7 @@ int main_ls(int argc, char *argv[])
user=pwd?pwd->pw_name:"nouser";
grp=getgrgid(stat_buf.st_gid);
group=grp?grp->gr_name:"nogrp";
- printf("%c%c%c%c%c%c%c%c%c%c %3d %6.6s %6.6s %11d %s %s%c\n",
+ fprintf(stdout,"%c%c%c%c%c%c%c%c%c%c %3d %6.6s %6.6s %11d %s %s%c\n",
(S_ISLNK(stat_buf.st_mode)?('l'):
(S_ISDIR(stat_buf.st_mode)?('d'):('-'))),
(stat_buf.st_mode & S_IRUSR)?('r'):('-'),
@@ -313,7 +313,7 @@ int main_ls(int argc, char *argv[])
size+=stat_buf.st_size;
}
}
- printf("%d files %d bytes occupied\n",n,size);
+ fprintf(stdout,"%d files %d bytes occupied\n",n,size);
closedir(dirp);
return 0;
}
@@ -321,7 +321,7 @@ int main_ls(int argc, char *argv[])
int main_pwd (int argc, char *argv[]) {
char dir[1024];
getcwd(dir,1024);
- printf("%s\n",dir);
+ fprintf(stdout,"%s\n",dir);
return 0;
}
/*-----------------------------------------------------------*/
@@ -330,7 +330,7 @@ int main_chdir (int argc, char *argv[]) {
dir="/";
if (argc>1) dir=argv[1];
if (chdir(dir)) {
- printf("chdir to '%s' failed:%s\n",dir,strerror(errno));
+ fprintf(stdout,"chdir to '%s' failed:%s\n",dir,strerror(errno));
return errno;
};
return 0;
@@ -343,7 +343,7 @@ int main_mkdir (int argc, char *argv[]) {
while (n<argc) {
dir=argv[n++];
if (mkdir(dir,S_IRWXU|S_IRWXG|S_IRWXO)) {
- printf("mkdir '%s' failed:%s\n",dir,strerror(errno));
+ fprintf(stdout,"mkdir '%s' failed:%s\n",dir,strerror(errno));
};
};
return errno;
@@ -356,7 +356,7 @@ int main_rmdir (int argc, char *argv[])
n=1;
while (n<argc) {
dir=argv[n++];
- if (rmdir(dir)) printf("rmdir '%s' failed:%s\n",dir,strerror(errno));
+ if (rmdir(dir)) fprintf(stdout,"rmdir '%s' failed:%s\n",dir,strerror(errno));
};
return errno;
}
@@ -365,7 +365,7 @@ int main_chroot(int argc,char * argv[]) {
char * new_root="/";
if (argc==2) new_root=argv[1];
if (chroot(new_root)<0) {
- printf("error %s:chroot(%s);\n",strerror(errno),new_root);
+ fprintf(stdout,"error %s:chroot(%s);\n",strerror(errno),new_root);
return -1;
};
return 0;
@@ -385,7 +385,7 @@ int main_rm (int argc, char *argv[])
n=1;
while (n<argc) {
if (unlink(argv[n])) {
- printf("error %s:rm %s\n",strerror(errno),argv[n]);
+ fprintf(stdout,"error %s:rm %s\n",strerror(errno),argv[n]);
return -1;
};
n++;
@@ -399,20 +399,20 @@ int main_date(int argc,char *argv[])
{
time_t t;
time(&t);
- printf("%s", ctime(&t));
+ fprintf(stdout,"%s", ctime(&t));
return 0;
}
/*-----------------------------------------------------------*/
int main_logoff(int argc,char *argv[])
{
- printf("logoff from the system...");
+ fprintf(stdout,"logoff from the system...");
current_shell_env->exit_shell=TRUE;
return 0;
}
/*-----------------------------------------------------------*/
int main_tty (int argc,char *argv[])
{
- printf("%s\n",ttyname(fileno(stdin)));
+ fprintf(stdout,"%s\n",ttyname(fileno(stdin)));
return 0;
}
/*-----------------------------------------------------------*/
@@ -420,7 +420,7 @@ int main_whoami(int argc,char *argv[])
{
struct passwd * pwd;
pwd=getpwuid(getuid());
- printf("%s\n",pwd?pwd->pw_name:"nobody");
+ fprintf(stdout,"%s\n",pwd?pwd->pw_name:"nobody");
return 0;
}
/*-----------------------------------------------------------*/
@@ -430,12 +430,12 @@ int main_id (int argc,char *argv[])
struct group * grp;
pwd=getpwuid(getuid());
grp=getgrgid(getgid());
- printf("uid=%d(%s),gid=%d(%s),",
+ fprintf(stdout,"uid=%d(%s),gid=%d(%s),",
getuid(),pwd?pwd->pw_name:"",
getgid(),grp?grp->gr_name:"");
pwd=getpwuid(geteuid());
grp=getgrgid(getegid());
- printf("euid=%d(%s),egid=%d(%s)\n",
+ fprintf(stdout,"euid=%d(%s),egid=%d(%s)\n",
geteuid(),pwd?pwd->pw_name:"",
getegid(),grp?grp->gr_name:"");
return 0;
@@ -447,7 +447,7 @@ int main_umask(int argc,char *argv[])
if (argc == 2) msk=str2int(argv[1]);
umask(msk);
msk=umask(0);
- printf("0%o\n", (unsigned int) msk);
+ fprintf(stdout,"0%o\n", (unsigned int) msk);
umask(msk);
return 0;
}
diff --git a/cpukit/libmisc/shell/shell.c b/cpukit/libmisc/shell/shell.c
index 4f106d5390..01a9c36ec8 100644
--- a/cpukit/libmisc/shell/shell.c
+++ b/cpukit/libmisc/shell/shell.c
@@ -180,11 +180,11 @@ int shell_make_args(char * cmd,
int shell_help_cmd(shell_cmd_t * shell_cmd) {
char * pc;
int col,line;
- printf("%-10.10s -",shell_cmd->name);
+ fprintf(stdout,"%-10.10s -",shell_cmd->name);
col=12;
line=1;
if (shell_cmd->alias) {
- printf("is an <alias> for command '%s'",shell_cmd->alias->name);
+ fprintf(stdout,"is an <alias> for command '%s'",shell_cmd->alias->name);
} else
if (shell_cmd->usage) {
pc=shell_cmd->usage;
@@ -206,7 +206,7 @@ int shell_help_cmd(shell_cmd_t * shell_cmd) {
};
};
if (!col && *pc) {
- printf(" ");
+ fprintf(stdout," ");
col=12;line++;
};
};
@@ -224,51 +224,51 @@ int shell_help(int argc,char * argv[]) {
shell_topic_t *topic;
shell_cmd_t * shell_cmd=shell_first_cmd;
if (argc<2) {
- printf("help: ('r' repeat last cmd - 'e' edit last cmd)\n"
+ fprintf(stdout,"help: ('r' repeat last cmd - 'e' edit last cmd)\n"
" TOPIC? The topics are\n");
topic=shell_first_topic;
col=0;
while (topic) {
if (!col){
- col=printf(" %s",topic->topic);
+ col=fprintf(stdout," %s",topic->topic);
} else {
if ((col+strlen(topic->topic)+2)>78){
- printf("\n");
- col=printf(" %s",topic->topic);
+ fprintf(stdout,"\n");
+ col=fprintf(stdout," %s",topic->topic);
} else {
- col+=printf(", %s",topic->topic);
+ col+=fprintf(stdout,", %s",topic->topic);
};
};
topic=topic->next;
};
- printf("\n");
+ fprintf(stdout,"\n");
return 1;
};
line=0;
for (arg=1;arg<argc;arg++) {
if (line>16) {
- printf("Press any key to continue...");getchar();
- printf("\n");
+ fprintf(stdout,"Press any key to continue...");getchar();
+ fprintf(stdout,"\n");
line=0;
};
topic=shell_lookup_topic(argv[arg]);
if (!topic){
if ((shell_cmd=shell_lookup_cmd(argv[arg]))==NULL) {
- printf("help: topic or cmd '%s' not found. Try <help> alone for a list\n",argv[arg]);
+ fprintf(stdout,"help: topic or cmd '%s' not found. Try <help> alone for a list\n",argv[arg]);
line++;
} else {
line+=shell_help_cmd(shell_cmd);
}
continue;
};
- printf("help: list for the topic '%s'\n",argv[arg]);
+ fprintf(stdout,"help: list for the topic '%s'\n",argv[arg]);
line++;
while (shell_cmd) {
if (!strcmp(topic->topic,shell_cmd->topic))
line+=shell_help_cmd(shell_cmd);
if (line>16) {
- printf("Press any key to continue...");getchar();
- printf("\n");
+ fprintf(stdout,"Press any key to continue...");getchar();
+ fprintf(stdout,"\n");
line=0;
};
shell_cmd=shell_cmd->next;
@@ -569,7 +569,7 @@ rtems_task shell_shell(rtems_task_argument task_argument) {
setvbuf(stdout,NULL,_IONBF,0); /* Not buffered*/
stderr=fopen(devname,"r+");
if (!stderr) {
- printf("shell:unable to open stderr.%s:%s\n",devname,strerror(errno));
+ fprintf(stdout,"shell:unable to open stderr.%s:%s\n",devname,strerror(errno));
};
/* when the future user environment runs ok
* a freopen() reopens the terminals. Now this don't work
@@ -588,7 +588,7 @@ rtems_task shell_shell(rtems_task_argument task_argument) {
cat_file(stdout,"/etc/motd");
strcpy(last_cmd,"");
strcpy(cmd,"");
- printf("\n"
+ fprintf(stdout,"\n"
"RTEMS SHELL (Ver.1.0-FRC):%s. "__DATE__". 'help' to list commands.\n",devname);
chdir("/"); /* XXX: chdir to getpwent homedir */
shell_env->exit_shell=FALSE;
@@ -596,7 +596,7 @@ rtems_task shell_shell(rtems_task_argument task_argument) {
/* Prompt section */
/* XXX: show_prompt user adjustable */
getcwd(curdir,sizeof(curdir));
- printf("%s [%s] %c ",shell_env->taskname,curdir,geteuid()?'$':'#');
+ fprintf(stdout,"%s [%s] %c ",shell_env->taskname,curdir,geteuid()?'$':'#');
/* getcmd section */
if (!shell_scanline(cmd,sizeof(cmd),stdin,stdout)) break; /*EOF*/
/* evaluate cmd section */
@@ -621,7 +621,7 @@ rtems_task shell_shell(rtems_task_argument task_argument) {
if ((shell_cmd=shell_lookup_cmd(argv[0]))!=NULL) {
shell_env->errorlevel=shell_cmd->command(argc,argv);
} else {
- printf("shell:%s command not found\n",argv[0]);
+ fprintf(stdout,"shell:%s command not found\n",argv[0]);
shell_env->errorlevel=-1;
};
};
@@ -629,7 +629,7 @@ rtems_task shell_shell(rtems_task_argument task_argument) {
if (shell_env->exit_shell) break;
cmd[0]=0;
};
- printf("\nGoodbye from RTEMS SHELL :-(\n");
+ fprintf(stdout,"\nGoodbye from RTEMS SHELL :-(\n");
};
} while (shell_env->forever);
fclose(stdin );
diff --git a/cpukit/libmisc/shell/shell.h b/cpukit/libmisc/shell/shell.h
index c4bf49067a..c95bef5436 100644
--- a/cpukit/libmisc/shell/shell.h
+++ b/cpukit/libmisc/shell/shell.h
@@ -16,14 +16,14 @@
#ifndef __SHELL_H__
#define __SHELL_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <rtems.h>
#include <stdio.h>
#include <termios.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef int (*shell_command_t)(int argc,char * argv[]);
struct shell_cmd_tt ;
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
index 11ee97c228..e5ae3c7970 100644
--- a/cpukit/libmisc/stackchk/check.c
+++ b/cpukit/libmisc/stackchk/check.c
@@ -480,7 +480,7 @@ void Stack_check_Dump_threads_usage(
name[ 4 ] = '\0';
}
- printf( "0x%08x %4s 0x%08x 0x%08x %8d %8d\n",
+ fprintf(stdout, "0x%08x %4s 0x%08x 0x%08x %8d %8d\n",
the_thread ? the_thread->Object.id : ~0,
name,
(uint32_t ) stack->area,
@@ -524,8 +524,8 @@ void Stack_check_Dump_usage( void )
if (stack_check_initialized == 0)
return;
- printf("Stack usage by thread\n");
- printf(
+ fprintf(stdout,"Stack usage by thread\n");
+ fprintf(stdout,
" ID NAME LOW HIGH AVAILABLE USED\n"
);
diff --git a/cpukit/libmisc/untar/untar.c b/cpukit/libmisc/untar/untar.c
index 54f7acebaf..ad3b789f08 100644
--- a/cpukit/libmisc/untar/untar.c
+++ b/cpukit/libmisc/untar/untar.c
@@ -204,7 +204,7 @@ Untar_FromMemory(unsigned char *tar_buf, unsigned long size)
nblocks = (((file_size) + 511) & ~511) / 512;
if ((fp = fopen(fname, "w")) == NULL)
{
- printf("Untar failed to create file %s\n", fname);
+ fprintf(stdout,"Untar failed to create file %s\n", fname);
ptr += 512 * nblocks;
}
else
@@ -222,7 +222,7 @@ Untar_FromMemory(unsigned char *tar_buf, unsigned long size)
n = fwrite(&tar_buf[ptr], 1, len, fp);
if (n != len)
{
- printf("Error during write\n");
+ fprintf(stdout,"Error during write\n");
break;
}
ptr += 512;