diff options
Diffstat (limited to 'user/forktest.c')
-rw-r--r-- | user/forktest.c | 14 |
1 files changed, 7 insertions, 7 deletions
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<N; n++){ pid = fork(); @@ -29,23 +29,23 @@ forktest(void) } if(n == N){ - printf(1, "fork claimed to work N times!\n", N); + print("fork claimed to work N times!\n"); exit(); } for(; 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 |