Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import fcntl
- def set_close_exec(fd):
- """
- Helper to add CLOEXEC to provided file descriptor.
- :param fd: int
- """
- flags = fcntl.fcntl(fd, fcntl.F_GETFD)
- fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement