Re: ENOTTY from ext3 code?

From: Andreas Dilger (adilger@turbolabs.com)
Date: Tue Feb 19 2002 - 16:20:00 EST


On Feb 19, 2002 12:56 -0800, Andrew Morton wrote:
> Pavel Machek wrote:
> > ext3/ioctl.c:
> >
> > ...
> > return -ENOTTY;
> >
> > Does it really make sense to return "not a typewriter" from ext3
> > ioctl?
>
> ERRORS
> ...
>
> ENOTTY The specified request does not apply to the kind of
> object that the descriptor d references.
>
> Lots and lots of ioctls return ENOTTY when passed a request
> which they don't understand. There's probably a great reason
> for this, but I can't immediately think what it might be.

Well, returning ENOTTY for unknown ioctls instead of EINVAL allows you
to distinguish between 'I have no idea what you are asking of me' and
'you passed me the incorrect parameter to this request' in the caller.

Cheers, Andreas

--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:22 EST