Eva*_*oll 4 file-descriptors fork
如果一个程序运行fork()
什么设置标准流STDOUT
,STDIN
和STDERR
?
标准输入、标准输出和标准错误是从父进程继承的。如果需要,由子进程将它们更改为指向新文件。
从fork(2)
手册页:
* The child inherits copies of the parent's set of open file descrip?
tors. Each file descriptor in the child refers to the same open
file description (see open(2)) as the corresponding file descriptor
in the parent.
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3410 次 |
最近记录: |