xv6-65oo2/user1.c
2006-06-27 14:35:53 +00:00

21 lines
257 B
C

char buf[32];
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");
}
while(1)
;
}