From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9810 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: recvmsg/sendmsg broken on mips64 Date: Fri, 1 Apr 2016 11:49:20 +0200 Message-ID: <20160401094919.GT9862@port70.net> References: <20160331192518.GW21636@brightrain.aerifal.cx> <20160331201012.GR9862@port70.net> <20160331203004.GX21636@brightrain.aerifal.cx> <76c20e67-4d62-a929-9f1d-a3fc63758426@dd-wrt.com> 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 1459504176 3375 80.91.229.3 (1 Apr 2016 09:49:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 09:49:36 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9823-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 01 11:49:36 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 1alvhu-0004tv-HH for gllmg-musl@m.gmane.org; Fri, 01 Apr 2016 11:49:34 +0200 Original-Received: (qmail 25645 invoked by uid 550); 1 Apr 2016 09:49:32 -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 25627 invoked from network); 1 Apr 2016 09:49:32 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <76c20e67-4d62-a929-9f1d-a3fc63758426@dd-wrt.com> User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9810 Archived-At: * Sebastian Gottschall [2016-04-01 11:16:20 +0200]: > I discovered that the whole recvmsg/sendmsg code is broken in mips64 > but i found also the solution > i throwed out all the _pad1, _pad2 crap in socket.h and the corrosponding > code in recvmsg.c etc. > and used size_t instead. this works at the end. i see no reason for this > padding, since using the correct datatype will handle it in the same way. > this solution may also work for other 64 bit targets. so proposal is fixing > the datatype instead of using int with padding in case of 64 bit > the padding is needed, i think __BIG_ENDIAN or __LITTLE_ENDIAN might not be defined properly. your fix is non-conforming and breaks both abi and api, the definition must match http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html > this here is my working struct in mips64 (big endian) > > struct msghdr { > void *msg_name; > socklen_t msg_namelen; > struct iovec *msg_iov; > size_t msg_iovlen; > void *msg_control; > size_t msg_controllen; > int msg_flags; > }; > > struct cmsghdr { > size_t cmsg_len; > int cmsg_level; > int cmsg_type; > }; > > > Sebastian