code: def _ioctl_cast(n):
      
      if sys.version_info < (2, 5):
          n, = struct.unpack('i', struct.pack('I', n))
      return n
docs: Linux ioctl() request parameter is unsigned, whereas on BSD/Darwin it is
      signed. Until 2.5 Python exclusively implemented the BSD behaviour,
      preventing use of large unsigned int requests like the TTY layer uses
      below. So on 2.4, we cast our unsigned to look like signed for Python.