it must return errno, not -1, and should reject invalud values for how.
#include <signal.h>
+#include <errno.h>
#include "syscall.h"
#include "libc.h"
#include "pthread_impl.h"
int __sigprocmask(int how, const sigset_t *set, sigset_t *old)
{
sigset_t tmp;
+ if (how > 2U) {
+ errno = EINVAL;
+ return -1;
+ }
/* Disallow blocking thread control signals */
if (set && how != SIG_UNBLOCK) {
tmp = *set;
}
weak_alias(__sigprocmask, sigprocmask);
-weak_alias(__sigprocmask, pthread_sigmask);
--- /dev/null
+#include <signal.h>
+#include <errno.h>
+#include <pthread.h>
+
+int pthread_sigmask(int how, const sigset_t *set, sigset_t *old)
+{
+ int ret = sigprocmask(how, set, old);
+ if (ret) return errno;
+ return 0;
+}