performance: call ioctl() less often

We can save a system call here. Hooray :)