Perform the operation request on file descriptor fd.
The values used for request are operating system dependent, and are
available as constants in the fcntl or termios library modules, using
the same names as used in the relevant C header files.
The argument arg is optional, and defaults to 0; it may be an integer, a
bytes-like object or a string. If arg is given as a string, it will be
encoded to binary using the UTF-8 encoding.
If the arg given is an integer or if none is specified, the result value
is an integer corresponding to the return value of the ioctl() call in
the C code.
If the argument is a mutable buffer (such as a bytearray) and the
mutate_flag argument is true (default) then the buffer is (in effect)
passed to the operating system and changes made by the OS will be
reflected in the contents of the buffer after the call has returned.
The return value is the integer returned by the ioctl() system call.
If the argument is a mutable buffer and the mutable_flag argument is
false, the behavior is as if an immutable buffer had been passed.
If the argument is an immutable buffer then a copy of the buffer is
passed to the operating system and the return value is a bytes object of
the same length containing whatever the operating system put in the
buffer.