xv6-chinese icon indicating copy to clipboard operation
xv6-chinese copied to clipboard

Chapter0: 管道部分

Open HenryZ94264 opened this issue 1 year ago • 0 comments

接下来的示例代码运行了程序 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指的是标准输入

HenryZ94264 avatar Jun 08 '23 06:06 HenryZ94264