From 64b93d175ac6eb739036b394fbb0766fbf06f5b7 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Tue, 27 Aug 2019 13:13:03 -0400 Subject: user printf(1 -> printf( --- user/forktest.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'user/forktest.c') diff --git a/user/forktest.c b/user/forktest.c index be4915e..fa072ca 100644 --- a/user/forktest.c +++ b/user/forktest.c @@ -8,9 +8,9 @@ #define N 1000 void -printf(int fd, const char *s, ...) +print(const char *s) { - write(fd, s, strlen(s)); + write(1, s, strlen(s)); } void @@ -18,7 +18,7 @@ forktest(void) { int n, pid; - printf(1, "fork test\n"); + print("fork test\n"); for(n=0; n 0; n--){ if(wait() < 0){ - printf(1, "wait stopped early\n"); + print("wait stopped early\n"); exit(); } } if(wait() != -1){ - printf(1, "wait got too many\n"); + print("wait got too many\n"); exit(); } - printf(1, "fork test OK\n"); + print("fork test OK\n"); } int -- cgit v1.2.3