From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10254 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 16/16] fix struct termios in mips termios.h Date: Fri, 1 Jul 2016 15:00:00 -0400 Message-ID: <20160701190000.GD15995@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1467399623 3718 80.91.229.3 (1 Jul 2016 19:00:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2016 19:00:23 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10267-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jul 01 21:00:23 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bJ3fn-0000iL-7m for gllmg-musl@m.gmane.org; Fri, 01 Jul 2016 21:00:19 +0200 Original-Received: (qmail 7213 invoked by uid 550); 1 Jul 2016 19:00:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7193 invoked from network); 1 Jul 2016 19:00:15 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10254 Archived-At: On Sun, Apr 10, 2016 at 02:16:24PM +0200, Szabolcs Nagy wrote: > mips termios struct has no ispeed and ospeed members in glibc, > mips64 is already consistent with glibc. > > this is an abi change. > --- > arch/mips/bits/termios.h | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/arch/mips/bits/termios.h b/arch/mips/bits/termios.h > index 29b4b22..d97df8c 100644 > --- a/arch/mips/bits/termios.h > +++ b/arch/mips/bits/termios.h > @@ -1,13 +1,10 @@ > -struct termios > -{ > +struct termios { > tcflag_t c_iflag; > tcflag_t c_oflag; > tcflag_t c_cflag; > tcflag_t c_lflag; > cc_t c_line; > cc_t c_cc[NCCS]; > - speed_t __c_ispeed; > - speed_t __c_ospeed; > }; This patch (and the whole series) have been pending for a long time because I did not remember all the motivations behind what musl is doing now vs what glibc and the kernel do. I've finally gotten around to digging it up, and here's what the situation seems to be: While the kernel has lots of nasty legacy arch-specific termios variants, glibc unifies them (mostly, with some minor exceptions like omitting the speed fields on mips) and performs userspace translations. musl matches the glibc ABI on x86 and other "important ABI targets", but does not perform any translation. Instead we allow cc_line to move, and NCCS to vary (only if needed to make other members line up with the ABI!), on a per-arch basis so that the kernel interfaces can be used directly without translation. However, space for the unused speed fields (and for most archs, the excessive NCCS value) were kept around _in case_ we ever want to switch to doing some level of translation to provide these facilities. The space for these things is not to match existing kernel ABIs, but as safety room for extensibility. So I do not want to be removing them or introducing new archs that lack them. What I'd like to do is go ahead and add them back to mips64/n32 (where they were omitted) and drop this patch. Most of the rest of the patches in this series are probably okay; I'll continue reviewing them. The other mips64 ones need to be duplicated for n32, I think. Rich