9b37d1bfaa
Add cons_puts for cleaner output.
22 lines
274 B
C
22 lines
274 B
C
#include "user.h"
|
|
|
|
char buf[32];
|
|
|
|
int
|
|
main()
|
|
{
|
|
int pid, fds[2], n;
|
|
|
|
pipe(fds);
|
|
pid = fork();
|
|
if(pid > 0){
|
|
write(fds[1], "xyz", 4);
|
|
puts("w");
|
|
} else {
|
|
n = read(fds[0], buf, sizeof(buf));
|
|
puts("r: ");
|
|
puts(buf);
|
|
puts("\n");
|
|
}
|
|
for(;;);
|
|
}
|