【 在 flingfish 的大作中提到: 】
: 好问题,这个坑我也是Google了之后才搞清楚。
: * 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
: ...................
嗯,确实是父子进程共享文件描述符中的文件偏移,fork和open中都有说明;
2.6版本的linux支持O_CLOEXEC标识,应当就可以避免这样的问题了;
--
FROM 106.39.149.*