Problem in sysdeps/unix/sysv/linux/tcsetattr.c
Roland McGrath
roland@redhat.com
Tue Feb 18 03:29:00 GMT 2003
I don't know anything about what motivated this change other than what I
see in the comments and the entry in ChangeLog.9 about it (1998-12-07).
As far as I can tell, this code has always been wrong and the kernel
behavior is correct.
POSIX specifies that tcsetattr fails with EINVAL only if none of the
settings requested could be done. If some could be done but others are not
supported by the hardware, then it sets some and doesn't change others.
The pty "hardware" doesn't support changing the PARENB|CREAD|CSIZE bits, so
having them never change regardless of what's requested is correct. Since
it does succeed in setting the other attributes you asked for (such as the
fictional baud rate), there is never a reason it should return EINVAL.
I think the code that does TCGETS and checks should just be removed.
More information about the Libc-alpha
mailing list