duguosheng/6.S081-All-in-one

1.3翻译有歧义

Closed this issue · 1 comments

If no data is available, a read on a pipe waits for either data to be written or for all file descriptors referring to the write end to be closed; in the latter case, read will return 0, just as if the end of a data file had been reached. The fact that read blocks until it is impossible for new data to arrive is one reason that it’s important for the child to close the write end of the pipe before executing wc above: if one of wc ’s file descriptors referred to the write end of the pipe, wc would never see end-of-file.

如果没有可用的数据,则管道上的read操作等待写入数据或关闭所有指向写入端的文件描述符,在后一种情况下,read将返回0,就像到达数据文件的末尾一样。事实上,read在新数据不可能到达前会一直阻塞,这是子进程在执行上面的wc之前关闭管道的写入端非常重要的一个原因:如果wc的文件描述符之一指向管道的写入端,wc将永远看不到文件的结束。

其中
a read on a pipe waits for either data to be written or for all file descriptors referring to the write end to be closed
应该是:
则管道上的read操作要么等待写入数据,或者等待所有指向write end的fd都被关闭(wait either for A or for B)
翻译版可能会被理解为等待,或者关闭

虽然不是啥大问题,但是我初看看了两三遍都没看懂,翻了英文版才理解
稍微提一下,也许能帮到后来人

好的,已经修改~