change pointer type, ecalloc arguments, ioctl error handling, etc...