From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2293 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: termios ugliness Date: Fri, 16 Nov 2012 08:27:08 +0000 Message-ID: References: <20121116035211.GA30974@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec517ce76929e5e04ce988878 X-Trace: ger.gmane.org 1353054442 15937 80.91.229.3 (16 Nov 2012 08:27:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2012 08:27:22 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2294-gllmg-musl=m.gmane.org@lists.openwall.com Fri Nov 16 09:27:33 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TZHGv-0004h5-95 for gllmg-musl@plane.gmane.org; Fri, 16 Nov 2012 09:27:33 +0100 Original-Received: (qmail 27692 invoked by uid 550); 16 Nov 2012 08:27:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 27684 invoked from network); 16 Nov 2012 08:27:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=B/i+hHg8NZbil3vA0MIluehK5nPA5r8yIflWGXN4YA8=; b=qaIntXDvh8fpQ/oa3zOlIidj3z9u6R/lXHlQX183BYeu9W/hiUGqS7x23NdmuFOrBx jRB8xaKulrP9jblSoJaKfnKqE0Wz65Ihax8XtoAlWXfZPzhoxiQegKGsSRIb14bwtN1v mGx3InQhzJrxZeoClLWI7stch3Jx6FCZewWRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=B/i+hHg8NZbil3vA0MIluehK5nPA5r8yIflWGXN4YA8=; b=nEpN+UuwomT1DmI6X1zNQ40ADaZo8hdtIXB8hRvN/lDhvLta75RFWIqPstzB3NNk6b motHV1w3yU6FEQnvDLHGj17TG5r4PUk9hmx2v5bFdaifjcffp7iTGsrxMUZNjLFgm0QV PNUZoAXHs0OC7aOXPsSUlezRK3lGgvft6MzZUbbH/Vom0M4NxCJS2gNISRYrotLb4Hh0 erk3zinnJMwBYec3Os9oM+0Zae4kd3/b9Ut75bUyqRzuwAdN0bOjcYz4O3popogYM1eh jHE1PHOZUZv7pYwjqpqXv5tKCpznfN9QrApW3Rp7kFlsSAEbZj3kRmlqe6AYUJxAtRyo MeHw== In-Reply-To: <20121116035211.GA30974@brightrain.aerifal.cx> X-Gm-Message-State: ALoCoQnt5BU01mn6yj2IthBQ8s9PHOfOL9t7mv0PbbUpxRlDqyvjJdohRyK+yzCh+5YAhG3x60BL Xref: news.gmane.org gmane.linux.lib.musl.general:2293 Archived-At: --bcaec517ce76929e5e04ce988878 Content-Type: text/plain; charset=UTF-8 On 16 Nov 2012 03:52, "Rich Felker" wrote: > > 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 I would prefer the kernel structure. Justin --bcaec517ce76929e5e04ce988878 Content-Type: text/html; charset=UTF-8


On 16 Nov 2012 03:52, "Rich Felker" <dalias@aerifal.cx> wrote:
>
> 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

I would prefer the kernel structure.

Justin

--bcaec517ce76929e5e04ce988878--