mailing list of musl libc
 help / color / mirror / code / Atom feed
* termios ugliness
@ 2012-11-16  3:52 Rich Felker
  2012-11-16  4:42 ` Kurt H Maier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rich Felker @ 2012-11-16  3:52 UTC (permalink / raw)
  To: musl

Hi all,

In the process of integrating the powerpc port, it's come to my
attention that the termios structure (used for setting terminal
attributes) differs gratuitously between archs at the kernel level.
glibc (and thus the LSB ABI, which we've tried to follow) fudges
around this by always using the same userspace structure and
translating from the kernelspace structure. I'm not sure what the
benefit of this is (aside from having extra slots for expansion in
c_cc array), but the downsides are (1) binary bloat and ugly
arch-specific code for conversion, and (2) failure of a direct TCGETS
ioctl (as opposed to a tcgetattr function call) to fill the struct
properly, since it bypasses the translation.

My leaning is to ignore the existing ABI on this and just use the
arch-specific structure from the kernel on ppc and any other archs
with this brokenness (alpha seems to be the main other one, possibly
the only). Unlike x86, x86_64, or arm, I don't see a lot of usefulness
in running glibc binaries on musl-powerpc; if it's ever needed, we
could do patch-up work in the dynamic linker (which will eventually be
needed anyway to deal with wrong regoff_t on x86_64 and 32-bit-off_t
functions on 32-bit archs) to load such apps/libs.

Since it's a decision we can't really change later without breaking
ABI, though, I'd like to ask the community: does anybody have a strong
feeling about whether we should use the kernel termios structure
directly or do like glibc and use an arch-generic userspace termios
structure and code to convert to/from the kernel version?

The powerpc port will probably be considered experimental in the
upcoming release, so we can take our time on the issue a bit, but I'd
still rather hear comments sooner than later if you have some.

Rich


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-17  1:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16  3:52 termios ugliness Rich Felker
2012-11-16  4:42 ` Kurt H Maier
2012-11-16  8:27 ` Justin Cormack
2012-11-16 16:34 ` John Spencer
2012-11-16 18:59   ` Rich Felker
2012-11-17  1:46     ` Alex Caudill

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).