[PATCH] sysconf: handle _SC_MINSIGSTKSZ and _SC_SIGSTKSZ

46 views
Skip to first unread message

Waldemar Kozaczuk

unread,
May 11, 2022, 5:53:53 PM5/11/22
to osv...@googlegroups.com, Waldemar Kozaczuk
New versions (>= ~1.74) of boost unit test library used by some of our
tests started using sysconf() with argument _SC_SIGSTKSZ to determine
size of the signal stack size.

This patch enhances the sysconf() implementation to handle _SC_MINSIGSTKSZ
and _SC_SIGSTKSZ.

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>
---
include/api/unistd.h | 2 ++
runtime.cc | 2 ++
2 files changed, 4 insertions(+)

diff --git a/include/api/unistd.h b/include/api/unistd.h
index 4cf86adb..cb5f4489 100644
--- a/include/api/unistd.h
+++ b/include/api/unistd.h
@@ -470,6 +470,8 @@ void syncfs(int);
#define _SC_XOPEN_STREAMS 246
#define _SC_THREAD_ROBUST_PRIO_INHERIT 247
#define _SC_THREAD_ROBUST_PRIO_PROTECT 248
+#define _SC_MINSIGSTKSZ 249
+#define _SC_SIGSTKSZ 250

#define _CS_PATH 0
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1
diff --git a/runtime.cc b/runtime.cc
index 3942982c..521b5c24 100644
--- a/runtime.cc
+++ b/runtime.cc
@@ -379,6 +379,8 @@ long sysconf(int name)
case _SC_THREAD_SAFE_FUNCTIONS: return 1;
case _SC_GETGR_R_SIZE_MAX: return 1;
case _SC_OPEN_MAX: return FDMAX;
+ case _SC_MINSIGSTKSZ: return MINSIGSTKSZ;
+ case _SC_SIGSTKSZ: return SIGSTKSZ;
default:
debug(fmt("sysconf(): stubbed for parameter %1%\n") % name);
errno = EINVAL;
--
2.34.1

Commit Bot

unread,
May 13, 2022, 5:21:19 PM5/13/22
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
Branch: master

sysconf: handle _SC_MINSIGSTKSZ and _SC_SIGSTKSZ

New versions (>= ~1.74) of boost unit test library used by some of our
tests started using sysconf() with argument _SC_SIGSTKSZ to determine
size of the signal stack size.

This patch enhances the sysconf() implementation to handle _SC_MINSIGSTKSZ
and _SC_SIGSTKSZ.

Signed-off-by: Waldemar Kozaczuk <jwkoz...@gmail.com>

---
diff --git a/include/api/unistd.h b/include/api/unistd.h
--- a/include/api/unistd.h
+++ b/include/api/unistd.h
@@ -470,6 +470,8 @@ void syncfs(int);
#define _SC_XOPEN_STREAMS 246
#define _SC_THREAD_ROBUST_PRIO_INHERIT 247
#define _SC_THREAD_ROBUST_PRIO_PROTECT 248
+#define _SC_MINSIGSTKSZ 249
+#define _SC_SIGSTKSZ 250

#define _CS_PATH 0
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1
diff --git a/runtime.cc b/runtime.cc
Reply all
Reply to author
Forward
0 new messages