Make ioctl implementation BSD-friendly.