mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: what should be done with SA_INTERRUPT? (gpm 1.20.7)
  2014-07-16  1:16 what should be done with SA_INTERRUPT? (gpm 1.20.7) Isaac Dunham
@ 2014-07-15 19:03 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2014-07-15 19:03 UTC (permalink / raw)
  To: Isaac Dunham; +Cc: musl, alpine-devel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* what should be done with SA_INTERRUPT? (gpm 1.20.7)
@ 2014-07-16  1:16 Isaac Dunham
  2014-07-15 19:03 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Isaac Dunham @ 2014-07-16  1:16 UTC (permalink / raw)
  To: musl, alpine-devel

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).

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


Thanks,
Isaac Dunham



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-16  1:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16  1:16 what should be done with SA_INTERRUPT? (gpm 1.20.7) Isaac Dunham
2014-07-15 19:03 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).