docs: def set_blocking(fd, blocking=True):
      """
      Set the given file-descriptor blocking or non-blocking.
  
      Returns the original blocking status.
      """
  
      old_flag = fcntl.fcntl(fd, fcntl.F_GETFL)
  
      if blocking:
          new_flag = old_flag & ~ os.O_NONBLOCK
      else:
          new_flag = old_flag | os.O_NONBLOCK
  
      fcntl.fcntl(fd, fcntl.F_SETFL, new_flag)
  
      return not bool(old_flag & os.O_NONBLOCK)