fixed ioctl arg type
Fixed compilation for x86
cleaned up header files