summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel <dkozovsk@redhat.com>2018-07-26 15:39:12 +0200
committerSven Eden <sven.eden@prydeworx.com>2018-10-29 10:18:24 +0100
commit3e97e583ba49c666e12c5d772b361bde8cfa464a (patch)
treeb2bc8fad5c37338aae871c60c6922d0e7fe43985
parent37c076d26669a3c39fd6e931da5b66b9edb4ce63 (diff)
void call of page_size guarantees that sysconf is not called from signal handler
(cherry picked from commit 1595b257df98b361d178b3ce3e4ca5ac463be0cd)
-rw-r--r--src/basic/sigbus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/sigbus.c b/src/basic/sigbus.c
index 70afba6bc..d5254eab9 100644
--- a/src/basic/sigbus.c
+++ b/src/basic/sigbus.c
@@ -113,6 +113,10 @@ void sigbus_install(void) {
.sa_flags = SA_SIGINFO,
};
+ /* make sure that sysconf() is not called from a signal handler because
+ * it is not guaranteed to be async-signal-safe since POSIX.1-2008 */
+ (void) page_size();
+
n_installed++;
if (n_installed == 1)