Advertisement
Guest User

Untitled

a guest
May 24th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. import fcntl
  2.  
  3. def set_close_exec(fd):
  4. """
  5. Helper to add CLOEXEC to provided file descriptor.
  6. :param fd: int
  7. """
  8. flags = fcntl.fcntl(fd, fcntl.F_GETFD)
  9. fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement