using ioctl directly