Changed addressof() to byref() inside ioctl. Replaced fcntl's ioctl with libc's ioctl