Re: [PATCH] remove TCGETS

Linus Torvalds <[email protected]> Tue, 28 Oct 2003 13:07:53 -0800 (PST)
Newsgroups gmane.comp.file-systems.intermezzo.devel,gmane.linux.file-systems
Message-ID <[email protected]>
On Tue, 28 Oct 2003, David Woodhouse wrote:
>
> Linus; executive decision required please:

I don't know you you _require_ an executive decision, but the simple fact 
is that the regular Linux ioctl() handler always returns ENOTTY if it 
doesn't match a ioctl number. See fs/ioctl.c.

In short, the way I think this should be handled is:
 - if you don't recognize the ioctl, you should return ENOTTY
 - if you recognize the ioctl, but some parameter to the ioctl is wrong, 
   you should return EINVAL.

This is consistent with file_ioctl(), and also consistent with traditional
uses of ENOTTY. It also just happens to make LTP pass, but I will leave to
you to make up your own mind on whether that is because LTP is a good
test, or whether it's just a small unimportant detail.

		Linus



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/