mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: termios ugliness
Date: Thu, 15 Nov 2012 22:52:11 -0500	[thread overview]
Message-ID: <20121116035211.GA30974@brightrain.aerifal.cx> (raw)

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


             reply	other threads:[~2012-11-16  3:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16  3:52 Rich Felker [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121116035211.GA30974@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).