This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/10339] Terminal interface: non-standard baudrates are not handled properly on Linux-systems


https://sourceware.org/bugzilla/show_bug.cgi?id=10339

--- Comment #4 from hpa at zytor dot com <hpa at zytor dot com> ---
The problem with just dropping the existing Bxxx constants is that they are an
ABI, and at least without versioning the interfaces it will break legacy
applications.

We can do that, of course, if that's the way to go.  The new interfaces would
then always treat the value as an integer, and e.g. B300 == 300.

The reason the POSIX interfaces are fundamentally broken is that they rely on
an enumeration of values which are simple integers (or even really arbitrary
real numbers.)  Instead of having cf*speed() abstract this out, they exposed it
to applications, and didn't even provide a mean to enumerate available values.

So the POSIX interfaces as they currently sit are broken, and there is no way
for a portable application to be able to do things sanely at all.  This would
be the reason to get POSIX to add new interfaces, which would also take the
place of the versioned interface I mentioned above.  It would be the
responsibility of new POSIX implementations to properly abstract this out; the
implementation is trivial even if arbitrary rates aren't natively supported
(just a table lookup and, for the setting interface, an error return.)

For implementations which already do it sanely (B300 == 300 etc), those would
simply be aliases for the current implementations.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]