repo.or.cz
/
mit-jos.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
segment_alloc may not allocate enough memory.
[mit-jos.git]
/
user
/
testkbd.c
blob
cdd083b9069dd93bc176b285039f07787dd63506
1
2
#include <inc/lib.h>
3
4
void
5
umain
(
void
)
6
{
7
int
r
;
8
9
close
(
0
);
10
if
((
r
=
opencons
()) <
0
)
11
panic
(
"opencons: %e"
,
r
);
12
if
(
r
!=
0
)
13
panic
(
"first opencons used fd %d"
,
r
);
14
if
((
r
=
dup
(
0
,
1
)) <
0
)
15
panic
(
"dup: %e"
,
r
);
16
17
for
(;;){
18
char
*
buf
;
19
20
buf
=
readline
(
"Type a line: "
);
21
if
(
buf
!=
NULL
)
22
fprintf
(
1
,
"%s
\n
"
,
buf
);
23
else
24
fprintf
(
1
,
"(end of file received)
\n
"
);
25
}
26
}