Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 15 Nov 2012 22:52:11 -0500
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: termios ugliness

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

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.