From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9208 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Separate siginfo_t for MIPS Date: Tue, 26 Jan 2016 23:24:54 +0100 Message-ID: <20160126222453.GN9621@port70.net> References: <20151210124712.3b4b811fd0d99a5b482b4ee3@ubnt.com> <20151210123633.GD23362@port70.net> <20151216043428.GC238@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" X-Trace: ger.gmane.org 1453847110 9041 80.91.229.3 (26 Jan 2016 22:25:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Jan 2016 22:25:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9221-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jan 26 23:25:10 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 1aOC2v-00065f-Ac for gllmg-musl@m.gmane.org; Tue, 26 Jan 2016 23:25:09 +0100 Original-Received: (qmail 26148 invoked by uid 550); 26 Jan 2016 22:25:06 -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 26127 invoked from network); 26 Jan 2016 22:25:05 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20151216043428.GC238@brightrain.aerifal.cx> User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9208 Archived-At: --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Rich Felker [2015-12-15 23:34:28 -0500]: > On Thu, Dec 10, 2015 at 01:36:33PM +0100, Szabolcs Nagy wrote: > > * Dmitry Ivanov [2015-12-10 12:47:12 +0200]: > > > MIPS has non-default siginfo_t structure. Also, some si_code values are > > > different. This patch is required for POSIX timers to work. ... > > until then i think it's enough to fix it in signal.h > > with some dirty ifdef around these members. > > Indeed, I think a makeshift solution could work okay here and avoid > moving this large, redundant structure into bits/signal.h. However I'd > rather not depend on compiler-predefined macros (like __mips__ in > Dmitry's second patch) in public headers, since we don't assume > particular compilers for compiling applications. > > Ideally bits/signal.h would define something in the reserved namespace > to change the behavior of the top-level signal.h. However > bits/signal.h needs to be towards the bottom of signal.h for other > reasons, so I don't see a really clean solution. Ideas? workaround solution attached, only build tested --M9NhX3UHpAaciwkO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sig.diff" diff --git a/arch/mips/bits/signal.h b/arch/mips/bits/signal.h index 818e0a7..50a0061 100644 --- a/arch/mips/bits/signal.h +++ b/arch/mips/bits/signal.h @@ -73,6 +73,18 @@ typedef struct __ucontext { #define SIG_UNBLOCK 2 #define SIG_SETMASK 3 +#undef SI_ASYNCIO +#undef SI_MESGQ +#undef SI_TIMER +#define SI_ASYNCIO (-2) +#define SI_MESGQ (-4) +#define SI_TIMER (-3) + +#undef si_errno +#undef si_code +#define si_errno __si_code +#define si_code __si_errno + #endif #define SIGHUP 1 diff --git a/include/signal.h b/include/signal.h index 559362f..3496942 100644 --- a/include/signal.h +++ b/include/signal.h @@ -86,7 +86,7 @@ union sigval { }; typedef struct { - int si_signo, si_errno, si_code; + int si_signo, __si_errno, __si_code; union { char __pad[128 - 2*sizeof(int) - sizeof(long)]; struct { @@ -127,6 +127,8 @@ typedef struct { } __sigsys; } __si_fields; } siginfo_t; +#define si_errno __si_errno +#define si_code __si_code #define si_pid __si_fields.__si_common.__first.__piduid.si_pid #define si_uid __si_fields.__si_common.__first.__piduid.si_uid #define si_status __si_fields.__si_common.__second.__sigchld.si_status --M9NhX3UHpAaciwkO--