From 4cd33557ff86b2fa5f147b24263b669539f92b4e Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 3 Feb 2013 14:50:55 -0500 Subject: software tidbits --- software/unix.page | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 software/unix.page (limited to 'software/unix.page') diff --git a/software/unix.page b/software/unix.page new file mode 100644 index 0000000..879d8d0 --- /dev/null +++ b/software/unix.page @@ -0,0 +1,10 @@ + +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(). -- cgit v1.2.3