Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2025 23:16:31 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 86f06e612b36 - main - Add POSIX NSIG_MAX & _SC_NSIG
Message-ID:  <202506112316.55BNGVcb045919@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=86f06e612b368e0e25080f1967a2e014e3891035

commit 86f06e612b368e0e25080f1967a2e014e3891035
Author:     Ricardo Branco <rbranco@suse.de>
AuthorDate: 2025-05-25 09:48:04 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-06-11 23:16:20 +0000

    Add POSIX NSIG_MAX & _SC_NSIG
    
    Signed-off-by: Ricardo Branco <rbranco@suse.de>
    Reviewed by: imp, kib
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1710
    Closes: https://github.com/freebsd/freebsd-src/pull/1710
---
 include/limits.h       | 1 +
 include/unistd.h       | 4 ++++
 lib/libc/gen/sysconf.c | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/include/limits.h b/include/limits.h
index ed8844e65642..2b75b94cb513 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -139,6 +139,7 @@
 
 #if __POSIX_VISIBLE >= 202405
 #define GETENTROPY_MAX		256
+#define NSIG_MAX		128	/* _SIG_MAXSIG from <signal.h> */
 #endif
 
 #include <sys/limits.h>
diff --git a/include/unistd.h b/include/unistd.h
index 33dd983eb11a..21e3a7740607 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -295,6 +295,10 @@ typedef	__useconds_t	useconds_t;
 #define	_SC_UEXTERR_MAXLEN	123 /* user */
 #endif
 
+#if __POSIX_VISIBLE >= 202405
+#define	_SC_NSIG		124
+#endif
+
 /* Extensions found in Solaris and Linux. */
 #define	_SC_PHYS_PAGES		121
 
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index d20b70590fb6..66562d0e29f0 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -287,6 +287,8 @@ do_NAME_MAX:
 		mib[0] = CTL_P1003_1B;
 		mib[1] = CTL_P1003_1B_MQ_OPEN_MAX;
 		goto yesno;
+	case _SC_NSIG:
+		return (_SIG_MAXSIG);
 	case _SC_PAGESIZE:
 		return (getpagesize());
 	case _SC_RTSIG_MAX:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202506112316.55BNGVcb045919>