From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5493 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general,gmane.linux.distributions.alpine.devel Subject: Re: what should be done with SA_INTERRUPT? (gpm 1.20.7) Date: Tue, 15 Jul 2014 15:03:01 -0400 Message-ID: <20140715190301.GG17402@brightrain.aerifal.cx> References: <20140716011646.GA1179@newbook> 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 1405451058 8074 80.91.229.3 (15 Jul 2014 19:04:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jul 2014 19:04:18 +0000 (UTC) Cc: musl@lists.openwall.com, alpine-devel@lists.alpinelinux.org To: Isaac Dunham Original-X-From: musl-return-5498-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 15 21:04:11 2014 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 1X781J-0008WJ-Fi for gllmg-musl@plane.gmane.org; Tue, 15 Jul 2014 21:04:09 +0200 Original-Received: (qmail 1832 invoked by uid 550); 15 Jul 2014 19:04:08 -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 1578 invoked from network); 15 Jul 2014 19:03:22 -0000 Content-Disposition: inline In-Reply-To: <20140716011646.GA1179@newbook> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5493 gmane.linux.distributions.alpine.devel:2079 Archived-At: On Tue, Jul 15, 2014 at 06:16:47PM -0700, Isaac Dunham wrote: > On alpine, gpm 1.20.7 doesn't build completely, so I've been poking at it. > There were numerous cases of sys/select.h being omitted, but the biggest > issue I've hit so far is the use of SA_INTERRUPT in a call to sigaction(); > the purpose is to break out of select() without it getting restarted. > musl does not define or support SA_INTERRUPT, as far as I can tell (I > seem to recall that musl forces SA_RESTART). No, per POSIX, interrupting is the default behavior of sigaction; SA_RESTART is needed to override this. The default you're thinking about is for the signal() function which should not be used anyway. There is no point at all in SA_INTERRUPT since it's required to be the default for sigaction; I'm assuming it came from some pre-POSIX era when the default was not clear. > This is in src/prog/gpm-root.y, which is the source for the "gpm-root" > utility. > > Any idea what to do about this? > I could build gpm without it, but (a) I'd like to see the whole mess > build, and (b) I'm not sure how to tell make that it can skip gpm-root. > > As a temporary fix, I'm using this patch: > -#if defined(__GLIBC__) > - __sigemptyset(&childaction.sa_mask); > -#else /* __GLIBC__ */ > - childaction.sa_mask=0; > -#endif /* __GLIBC__ */ > + sigemptyset(&childaction.sa_mask); > +#ifdef SA_INTERRUPT > childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */ > +#endif Just remove the SA_INTERRUPT line entirely and (like you're doing) use sigemptyset unconditionally. Rich