File Descriptors after fork() ------------------------------- When opening a file:: fcntl(fd, F_SETFD, FD_CLOEXEC); In python, you can pass the ``close_fds`` argument to subprocess.Popen() to close all file descriptors just after fork().