After the fork, the parent and child have copies of all open file descriptors and data values, so the pointer works for both.
执行fork之后,父进程和子进程获得打开的所有文件描述符和数据值的拷贝,所以指针对于它们都是有效的。
If a program has a file open before the fork, what happens if both processes try a read or a write?
如果在调用fork前,某个程序已经打开了一个文件,如果两个进程都尝试执行读取或写入,会发生什么情况呢?
"It's the little things that the hand allows me to do that have really made the difference," says Patrick. "I can open bottles with both hands now, hold my fork and tie my shoelaces."
“这只手使我能做的这些小事真的很不同,我可以用双手打开瓶盖,握住叉子以及系鞋带,”Patrick说道。
应用推荐