Fix an endian bug for the ioctl argument

The third argument of these ioctl calls must be an 32-bit integer, but 64-bit integers are used instead. This code works only on little-endian architectures, but not on big-endian architectures.

This patch fixes the size of the integer variables, and works with both endians.

Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>