OS.fork等子进程调用中FD的变化

Python中的OS.fork,exec之类的行为,可能导致stdout所指向的FD发生变化,有时候无法在终端获得想要的输出,这时候可能需要在执行子进程的时候手工设置其FD。

参考:

http://stackoverflow.com/questions/26578799/python-send-sigint-to-subprocess-using-os-kill-as-if-pressing-ctrlc

http://ipseek.blog.51cto.com/1041109/809467

http://stackoverflow.com/questions/9211190/python-fork-pipe-and-exec

http://bytes.com/topic/python/answers/836323-problem-threading-execv

Last modification:August 14th, 2017 at 10:22 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment