Thread (31 messages) 31 messages, 4 authors, 2025-07-10
STALE369d
Revisions (4)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]

[PATCH 1/3] compat/posix.h: track SA_RESTART fallback

From: Carlo Marcelo Arenas Belón via GitGitGadget <hidden>
Date: 2025-06-24 14:08:46
Subsystem: the rest · Maintainer: Linus Torvalds

From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <redacted>

Systems without SA_RESTART where using custom CFLAGS instead of
the standard header file.

Consolidate that, so it will be easier to use in a future commit.

Signed-off-by: Carlo Marcelo Arenas Belón <redacted>
---
 compat/posix.h   | 7 +++++++
 config.mak.uname | 3 ---
 2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/compat/posix.h b/compat/posix.h
index 067a00f33b83..2612a8515897 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -250,6 +250,13 @@ char *gitdirname(char *);
 #define NAME_MAX 255
 #endif
 
+/* On most systems <signal.h> would have given us this, but
+ * not on some systems (e.g. NonStop, QNX).
+ */
+#ifndef SA_RESTART
+#define SA_RESTART 0	/* disabled for sigaction() */
+#endif
+
 typedef uintmax_t timestamp_t;
 #define PRItime PRIuMAX
 #define parse_timestamp strtoumax
diff --git a/config.mak.uname b/config.mak.uname
index b1c5c4d5e8ed..52160ef5cb07 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -654,8 +654,6 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
 	FREAD_READS_DIRECTORIES = UnfortunatelyYes
 
 	# Not detected (nor checked for) by './configure'.
-	# We don't have SA_RESTART on NonStop, unfortunalety.
-	COMPAT_CFLAGS += -DSA_RESTART=0
 	# Apparently needed in compat/fnmatch/fnmatch.c.
 	COMPAT_CFLAGS += -DHAVE_STRING_H=1
 	NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
@@ -782,7 +780,6 @@ ifeq ($(uname_S),MINGW)
         endif
 endif
 ifeq ($(uname_S),QNX)
-	COMPAT_CFLAGS += -DSA_RESTART=0
 	EXPAT_NEEDS_XMLPARSE_H = YesPlease
 	HAVE_STRINGS_H = YesPlease
 	NEEDS_SOCKET = YesPlease
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help