xv6-chinese
xv6-chinese copied to clipboard
Chapter0: 管道部分
接下来的示例代码运行了程序 wc,它的标准输出绑定到了一个管道的读端口。
这句话对应原书中:
The following example code runs the program wc with standard input connected to the read end of a pipe.
这里应该是wc的标准输入绑定到了管道的读端?
By convention, a process reads from file descriptor 0 (standard input), writes output to file descriptor 1 (standard output), and writes error messages to file descriptor 2 (standard error).
代码中的argv[1] = 0
为wc的参数,根据上文指出,0指的是标准输入