From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9952 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: mips64/n32 struct termios Date: Tue, 26 Apr 2016 20:44:25 +0200 Message-ID: <20160426184425.GN22574@port70.net> References: <20160426172703.GP21636@brightrain.aerifal.cx> 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 1461696283 4610 80.91.229.3 (26 Apr 2016 18:44:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2016 18:44:43 +0000 (UTC) Cc: Jaydeep Patil To: musl@lists.openwall.com Original-X-From: musl-return-9965-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 26 20:44:42 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 1av7yU-00043L-N8 for gllmg-musl@m.gmane.org; Tue, 26 Apr 2016 20:44:42 +0200 Original-Received: (qmail 26610 invoked by uid 550); 26 Apr 2016 18:44:41 -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 26591 invoked from network); 26 Apr 2016 18:44:40 -0000 Mail-Followup-To: musl@lists.openwall.com, Jaydeep Patil Content-Disposition: inline In-Reply-To: <20160426172703.GP21636@brightrain.aerifal.cx> User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9952 Archived-At: * Rich Felker [2016-04-26 13:27:04 -0400]: > I noticed that the mips64/n32 versions of struct termios have omitted > the two speed_t fields at the end, which other archs (including mips) > all have. It's dubious whether these make sense or are useful for > anything, and I don't even recall the whole history of why we have > them, but as long as we do have them for all the other archs I kind of > think it makes sense to put them back for mips64/n32 in case we ever > need them for something (or for expansion) or want generic code to be > able to access them. > > Was there a reason they were omitted in the new ports? Any objection > to adding them back? see my [PATCH 16/16] fix struct termios in mips termios.h (that can be done in the other direction fixing mips64,n32) termios struct is special on mips and ppc: mips glibc: NCCS = 32, no speed fields mips linux: NCCS = 23 ppc glibc: NCCS = 32, speed fields ppc linux: NCCS = 19, c_line swapped, only termios, no termios2 other glibc: NCCS = 32, speed fields other linux: NCCS = 19 the kernel side only has speed fields in termios2 except on ppc where termios has them, in glibc termios has speed fields except on mips. (the __ prefixed fields are only present in musl probably to match the termios struct size on x86.) i don't know why there are these differences and how it can work in practice, but e.g. util-linux ldattach seems to use them with BOTHER cflag and probably one can query them with TCGETS(2). glibc tcsetattr/tcgetattr translates glibc termios to kernel termios, so one can set/get the fields that way too and there is further powerpc specific magic in that translation. > > Rich