Unknown ioctls return ENOTTY not EINVAL (Unix history...) so we need to do
the right thing. In addition we automatically set the errno so blkdev doesn't
have to care about it
blkdev_t *blk;
data; /* unused */
- if (request != BLKFLSBUF) {
- udata.u_error = ENXIO;
+ if (request != BLKFLSBUF)
return -1;
- }
/* we trust that blkdev_open() has already verified that this minor number is valid */
blk = &blkdev_table[minor >> 4];
if ((*dev_tab[major(dev)].dev_ioctl) (minor(dev), request, data)) {
if (!udata.u_error) // maybe the ioctl routine might set this?
- udata.u_error = EINVAL;
+ udata.u_error = ENOTTY;
return -1;
}