[PATCH] libc: Added sig2str/str2sig prototypes

Matt Joyce mfjoyce2004 at gmail.com
Wed Jun 16 20:22:36 UTC 2021


***As Requested: For Review Only. Does Not Compile***

Added definition of SIG2STR_MAX and function prototypes for sig2str
and str2sig in sys/signal.h in order to improve POSIX compliance.
---
 newlib/libc/include/sys/signal.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h
index 45cc0366c..fd2b3c672 100644
--- a/newlib/libc/include/sys/signal.h
+++ b/newlib/libc/include/sys/signal.h
@@ -238,6 +238,18 @@ int sigqueue (pid_t, int, const union sigval);
 
 #endif /* __POSIX_VISIBLE >= 199309 */
 
+#if __GNU_VISIBLE
+
+/* 202x_d2-POSIX-Issue-8, p. 327 adds SIG2STR_MAX, p. 332 adds sig2str()
+   and str2sig(). */
+
+#define SIG2STR_MAX 4294967295
+
+int sig2str(int, char *);
+int str2sig(const char *restrict, int *restrict);
+
+#endif /* __GNU_VISIBLE  */
+
 #if defined(___AM29K__)
 /* These all need to be defined for ANSI C, but I don't think they are
    meaningful.  */
-- 
2.31.1



More information about the devel mailing list