Datasheet

Standard C Implementation Definition
B-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
Interactive device
In an unhosted implementation of the ARM C library, the term interactive device might
be meaningless. The generic ARM C library supports a pair of devices, both called
:tt
,
intended to handle keyboard input and VDU screen output. In the generic
implementation:
no buffering is done on any stream connected to
:tt
unless input/output
redirection has occurred
if input/output redirection other than to
:tt
has occurred, full file buffering is used
(except that line buffering is used if both
stdout
and
stderr
were redirected to the
same file).
Standard input, output, and error streams
Using the generic ARM C library, the standard input (
stdin
), output (
stdout
) and error
streams (
stderr
) can be redirected at runtime. For example, if
mycopy
is a program,
running on a host debugger, that copies the standard input to the standard output, the
following line runs the program:
mycopy < infile > outfile 2> errfile
and redirects the files as follows:
stdin
The file is redirected to
infile
stdout
The file is redirected to
outfile
stderr
The file is redirected to
errfile
.
The permitted redirections are:
0< filename
This reads
stdin
from
filename
.
< filename
This reads
stdin
from
filename
.
1> filename
This writes
stdout
to
filename
.
> filename
This writes
stdout
to
filename
.
2> filename
This writes
stderr
to
filename
.
2>&1
This writes
stderr
to the same place as
stdout
.
>& file
This writes both
stdout
and
stderr
to
filename
.
>> filename
This appends
stdout
to
filename
.