summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2022-08-10 06:42:17 -0400
committerFrans Kaashoek <[email protected]>2022-08-10 07:21:50 -0400
commit07cf0eb25518089a96e8778e6809fc88d292ea5b (patch)
treee9407a34eca8681fab2568a3477154638c017f06
parentc908d2013233a6d60c2f37292dfd6ac18075d6d4 (diff)
downloadxv6-labs-07cf0eb25518089a96e8778e6809fc88d292ea5b.tar.gz
xv6-labs-07cf0eb25518089a96e8778e6809fc88d292ea5b.tar.bz2
xv6-labs-07cf0eb25518089a96e8778e6809fc88d292ea5b.zip
have sh print prompt with write, not printf, to make
system call lecture a little clearer.
-rw-r--r--user/sh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/user/sh.c b/user/sh.c
index 36245b3..864405d 100644
--- a/user/sh.c
+++ b/user/sh.c
@@ -134,7 +134,7 @@ runcmd(struct cmd *cmd)
int
getcmd(char *buf, int nbuf)
{
- fprintf(2, "$ ");
+ write(1, "$ ", 2);
memset(buf, 0, nbuf);
gets(buf, nbuf);
if(buf[0] == 0) // EOF