diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c
index e6026c22f4877aa8ec3a6eb361201bf85345917f..41452d8b5e2d088fc293096201c37a6639faba1e 100644
--- a/src/lib/core/popen.c
+++ b/src/lib/core/popen.c
@@ -993,7 +993,7 @@ signal_reset(void)
 
 	/* Unblock any signals blocked by libev */
 	sigfillset(&sigset);
-	if (sigprocmask(SIG_UNBLOCK, &sigset, NULL) == -1) {
+	if (pthread_sigmask(SIG_UNBLOCK, &sigset, NULL) == -1) {
 		say_error("child: SIG_UNBLOCK failed");
 		_exit(errno);
 	}
diff --git a/src/lib/core/say.c b/src/lib/core/say.c
index 378abb1fe74fd7500ecfb3343fbcab00c24d2d06..69c826264b1141b250da1fc5bf3962983afe28dc 100644
--- a/src/lib/core/say.c
+++ b/src/lib/core/say.c
@@ -381,8 +381,8 @@ log_pipe_init(struct log *log, const char *init_str)
 	sigemptyset(&mask);
 	sigaddset(&mask, SIGCHLD);
 
-	if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1)
-		say_syserror("sigprocmask");
+	if (pthread_sigmask(SIG_BLOCK, &mask, NULL) == -1)
+		say_syserror("pthread_sigmask");
 
 	if (pipe(pipefd) == -1) {
 		diag_set(SystemError, "failed to create pipe");
@@ -401,7 +401,7 @@ log_pipe_init(struct log *log, const char *init_str)
 	}
 
 	if (log->pid == 0) {
-		sigprocmask(SIG_UNBLOCK, &mask, NULL);
+		pthread_sigmask(SIG_UNBLOCK, &mask, NULL);
 
 		close(pipefd[1]);
 		dup2(pipefd[0], STDIN_FILENO);
@@ -443,7 +443,7 @@ log_pipe_init(struct log *log, const char *init_str)
 #endif
 #endif
 	/* OK, let's hope for the best. */
-	sigprocmask(SIG_UNBLOCK, &mask, NULL);
+	pthread_sigmask(SIG_UNBLOCK, &mask, NULL);
 	close(pipefd[0]);
 	log->fd = pipefd[1];
 	return 0;
diff --git a/src/main.cc b/src/main.cc
index a424073ed98e6f6378808d8c25ccc8548155b6ee..444f4a1fa5583e105be8ad25fa26226984eef29c 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -239,8 +239,8 @@ signal_reset(void)
 	/* Unblock any signals blocked by libev. */
 	sigset_t sigset;
 	sigfillset(&sigset);
-	if (sigprocmask(SIG_UNBLOCK, &sigset, NULL) == -1)
-		say_syserror("sigprocmask");
+	if (pthread_sigmask(SIG_UNBLOCK, &sigset, NULL) == -1)
+		say_syserror("pthread_sigmask");
 }
 
 static void
diff --git a/third_party/coro/coro.c b/third_party/coro/coro.c
index 5028e3c1466fecfa2b46b64c7e93db7a76290b25..125f715690fe84fb1084897e6d474acd4d2c9632 100644
--- a/third_party/coro/coro.c
+++ b/third_party/coro/coro.c
@@ -407,7 +407,7 @@ coro_create (coro_context *ctx, coro_func coro, void *arg, void *sptr, size_t ss
 
   sigemptyset (&nsig);
   sigaddset (&nsig, SIGUSR2);
-  sigprocmask (SIG_BLOCK, &nsig, &osig);
+  pthread_sigmask (SIG_BLOCK, &nsig, &osig);
 
   nsa.sa_handler = trampoline;
   sigemptyset (&nsa.sa_mask);
@@ -450,7 +450,7 @@ coro_create (coro_context *ctx, coro_func coro, void *arg, void *sptr, size_t ss
     sigaltstack (&ostk, 0);
 
   sigaction (SIGUSR2, &osa, 0);
-  sigprocmask (SIG_SETMASK, &osig, 0);
+  pthread_sigmask (SIG_SETMASK, &osig, 0);
 
 # elif CORO_LOSER
 
diff --git a/third_party/libev/ev.c b/third_party/libev/ev.c
index cdda9a0ffa880b5885b3f7a9ae8448c42799e5eb..04119bf987d7e89a16890208d51b785c175e544c 100644
--- a/third_party/libev/ev.c
+++ b/third_party/libev/ev.c
@@ -4649,7 +4649,7 @@ ev_signal_start (EV_P_ ev_signal *w) EV_NOEXCEPT
     {
       /* TODO: check .head */
       sigaddset (&sigfd_set, w->signum);
-      sigprocmask (SIG_BLOCK, &sigfd_set, 0);
+      pthread_sigmask (SIG_BLOCK, &sigfd_set, 0);
 
       signalfd (sigfd, &sigfd_set, 0);
     }
@@ -4681,7 +4681,7 @@ ev_signal_start (EV_P_ ev_signal *w) EV_NOEXCEPT
           {
             sigemptyset (&sa.sa_mask);
             sigaddset (&sa.sa_mask, w->signum);
-            sigprocmask (SIG_UNBLOCK, &sa.sa_mask, 0);
+            pthread_sigmask (SIG_UNBLOCK, &sa.sa_mask, 0);
           }
 #endif
       }
@@ -4717,7 +4717,7 @@ ev_signal_stop (EV_P_ ev_signal *w) EV_NOEXCEPT
           sigdelset (&sigfd_set, w->signum);
 
           signalfd (sigfd, &sigfd_set, 0);
-          sigprocmask (SIG_UNBLOCK, &ss, 0);
+          pthread_sigmask (SIG_UNBLOCK, &ss, 0);
         }
       else
 #endif