summaryrefslogtreecommitdiff
path: root/user/sh.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2022-08-10 06:42:17 -0400
committerRobert Morris <[email protected]>2022-08-10 06:42:17 -0400
commitc3a17f454a135dd1fc694ce8b203dda1233c341e (patch)
treee9407a34eca8681fab2568a3477154638c017f06 /user/sh.c
parent311479ceb74ecfed110cda4d07ac564fc4364ed2 (diff)
downloadxv6-labs-c3a17f454a135dd1fc694ce8b203dda1233c341e.tar.gz
xv6-labs-c3a17f454a135dd1fc694ce8b203dda1233c341e.tar.bz2
xv6-labs-c3a17f454a135dd1fc694ce8b203dda1233c341e.zip
have sh print prompt with write, not printf, to make
system call lecture a little clearer.
Diffstat (limited to 'user/sh.c')
-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