Subject: Re: [Bug 7635] New: ioctl(fd,TCSBRK,1) on socket yields EFAULT, expected EINVAL/ENOTTY

From: Eric Dumazet <[email-masked]>
Date: Sat, 09 Dec 2006 09:06:27 +0100

David Miller a écrit :
> From: Stephen Hemminger <[email-masked]>
> Date: Fri, 8 Dec 2006 14:00:21 -0800
> 
>> That is not true on BSD or other unix standardish ioctl's.
>> There are no conflicts between the TIOC... values and the SIOC... values
> 
> There is absolutely nothing that we can do about this under
> Linux without breaking every single application out there.
> 
> We allocated these values a long long time ago, before we
> got the idea that we should perhaps use some kind of
> macro system (as we mostly do now) to keep the values from
> conflicting.
> 
>> Seems like one of those annoying standards compliance test
>> return value bugs that shouldn't really hit an application.
> 
> Being non-compliant, and being unable to become compliant,
> it actually a feature and a huge weight off of our shoulders,
> don't you think?  :-)

Well, as long you/we dont break isattty() (which try an 
ioctl(fd,TCGETS,&termios) on the fd), it should be OK.

So TCGETS *MUST* return an error on a socket (and other non tty files)

Eric