[Bug 275328] <signal.h> fails to expose SA_* macros without XSI

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 25 Nov 2023 16:41:49 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275328

Warner Losh <imp@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |imp@FreeBSD.org
           Assignee|standards@FreeBSD.org       |imp@FreeBSD.org
             Status|New                         |Open

--- Comment #1 from Warner Losh <imp@FreeBSD.org> ---
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 0ab2a205a92c..8f3a0dec8fee 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -391,7 +391,7 @@ struct sigaction {
 #define        SA_NOCLDSTOP    0x0008  /* do not generate SIGCHLD on child
stop */
 #endif /* __POSIX_VISIBLE || __XSI_VISIBLE */

-#if __XSI_VISIBLE
+#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
 #define        SA_ONSTACK      0x0001  /* take signal on signal stack */
 #define        SA_RESTART      0x0002  /* restart system call on signal return
*/
 #define        SA_RESETHAND    0x0004  /* reset to SIG_DFL when taking signal
*/

Appears to be the ask. It seems reasonable. I'll note that there's a number of
alignment issues with the standards that we have (usually erring on the side of
defining too much). A large part of the reason for this is that while
POSIX.1-2008 (aka Issue 7) and (to a lessor degree) POSIX.1-2001 (issue 6) are
basically available, earlier versions are not, so it is kinda hard to
retrospectively get all the fiddly details right. other implementations also
are sloppy in this regard towards earlier standards, leading to the mistaken
impression that symbols are available earlier than they really are (note: note
the case here, this bug is spot on).

Unless I see an objection soonish, I'll commit and merge this in the coming
weeks.

Is there a specific port for this that prompted this test/bug?

-- 
You are receiving this mail because:
You are the assignee for the bug.