code: def set_cloexec(fd):
      
      flags = fcntl.fcntl(fd, fcntl.F_GETFD)
      assert fd > 2
      fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC)
docs: Set the file descriptor `fd` to automatically close on
      :func:`os.execve`. This has no effect on file descriptors inherited across
      :func:`os.fork`, they must be explicitly closed through some other means,
      such as :func:`mitogen.fork.on_fork`.