From patchwork Thu Mar 12 20:54:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 38536 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 5AFB7387701C for ; Thu, 12 Mar 2020 20:54:31 +0000 (GMT) Received: by mail-qt1-x843.google.com with SMTP id l21so5608795qtr.8 for ; Thu, 12 Mar 2020 13:54:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=zp7Kvnfe9+LjPQoXMbJqy7nSNx8n2dKRMfpwid5iQYk=; b=KDckRiMwy4mXNCGbxedUX77PlpzyouE3RsxIXUdLwE3HOLpAJXDNz+msU/6QmwtXmP bQ/QGh9Phc8sXXRt4Bt4yaRltIculodrUeJvxT0W+vivsTZOQkphMmXixFbT/QxQCQQu AqPZbF8srAul+nvOdnZP83swdqYBtIdVldDusGSPsvl6WnVRia4QXuCAUL3Og1c/Q7E7 i532tRyKs+oUK1akkgDIPzxR3gAM0EChDuQ5SL6mm1EG/wzZFXv5yhl/J3SVMP2WV1xb Sp8zWASDMwYeUCooYnQnmU9IGsRLC4Yj1636VjGiGFzG6IZtHldEzQaAEBz4ZaXwpC8J DhoA== X-Gm-Message-State: ANhLgQ3/ERMd6GUpO4WcMqEVTynRDO21f5jewNXA2Os6KxDKQPFqkVfK MK9Tz5+GM6uSwyYAtuhbu0wGhGt+FFQ= X-Google-Smtp-Source: ADFU+vsmtlmyN6jnnoUibnnXk+O7UzKAEzCkH4Ryee3Uylsq20K4VWPRIsB9dLp0cs6dzPmxrDPqfw== X-Received: by 2002:aed:2142:: with SMTP id 60mr4376083qtc.31.1584046469661; Thu, 12 Mar 2020 13:54:29 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id k11sm27862246qti.68.2020.03.12.13.54.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 13:54:29 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/3] nptl: Move pthread_sigmask implementation to libc Date: Thu, 12 Mar 2020 17:54:22 -0300 Message-Id: <20200312205424.17101-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-27.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2020 20:54:33 -0000 This is part of the libpthread removal project: For ia64-linux-gnu, the sigblock was never exported from libphread. Checked with a build against all affected ABIs. --- nptl/Makefile | 3 ++- nptl/Versions | 3 ++- nptl/libpthread-compat.c | 6 ++++++ sysdeps/ia64/nptl/Makefile | 4 ++-- sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/aarch64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/alpha/Makefile | 6 +++--- sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/csky/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c | 3 +-- sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist | 1 + sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/microblaze/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/microblaze/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../unix/sysv/linux/powerpc/powerpc32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist | 1 + .../unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist | 1 + .../unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist | 1 + sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist | 1 + sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist | 1 - sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist | 1 - 62 files changed, 45 insertions(+), 36 deletions(-) diff --git a/nptl/Makefile b/nptl/Makefile index e554a3898d..4816fa254e 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -59,6 +59,7 @@ routines = \ pthread_getschedparam \ pthread_self \ pthread_setschedparam \ + pthread_sigmask \ register-atfork \ shared-only-routines = forward @@ -123,7 +124,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ pthread_barrierattr_setpshared \ pthread_key_create pthread_key_delete \ pthread_getspecific pthread_setspecific \ - pthread_sigmask pthread_kill pthread_sigqueue \ + pthread_kill pthread_sigqueue \ pthread_cancel pthread_testcancel \ pthread_setcancelstate pthread_setcanceltype \ pthread_once \ diff --git a/nptl/Versions b/nptl/Versions index 543dddc4ee..145ee37d54 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -16,6 +16,7 @@ libc { pthread_mutex_lock; pthread_mutex_unlock; pthread_self; pthread_setcancelstate; pthread_setcanceltype; + pthread_sigmask; } GLIBC_2.1 { pthread_attr_init; @@ -60,7 +61,7 @@ libpthread { pthread_cancel; pthread_testcancel; pthread_setcancelstate; pthread_setcanceltype; - pthread_sigmask; pthread_kill; + pthread_kill; pthread_key_create; pthread_key_delete; pthread_getspecific; pthread_setspecific; diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c index 512b4c77c8..92c981c2d2 100644 --- a/nptl/libpthread-compat.c +++ b/nptl/libpthread-compat.c @@ -36,6 +36,12 @@ __libpthread_version_placeholder (void) version or later, the placeholder symbol is not needed because there are plenty of other symbols which populate those later versions. */ + +#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)) +compat_symbol_unique (libpthread, + __libpthread_version_placeholder, GLIBC_2_0); +#endif + #if (SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_2)) compat_symbol_unique (libpthread, __libpthread_version_placeholder, GLIBC_2_1_2); diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile index b7d87c37c8..d34cb27699 100644 --- a/sysdeps/ia64/nptl/Makefile +++ b/sysdeps/ia64/nptl/Makefile @@ -20,6 +20,6 @@ gen-as-const-headers += tcb-offsets.sym endif ifeq ($(subdir),nptl) -libpthread-routines += sysdep sigblock sigprocmask -libpthread-shared-only-routines += sysdep sigblock sigprocmask +libpthread-routines += sysdep +libpthread-shared-only-routines += sysdep endif diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index a4c31932cb..694efeb1e4 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -1447,6 +1447,7 @@ GLIBC_2.17 pthread_self F GLIBC_2.17 pthread_setcancelstate F GLIBC_2.17 pthread_setcanceltype F GLIBC_2.17 pthread_setschedparam F +GLIBC_2.17 pthread_sigmask F GLIBC_2.17 ptrace F GLIBC_2.17 ptsname F GLIBC_2.17 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist index d65beba958..48b368acb1 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist @@ -156,7 +156,6 @@ GLIBC_2.17 pthread_setconcurrency F GLIBC_2.17 pthread_setname_np F GLIBC_2.17 pthread_setschedprio F GLIBC_2.17 pthread_setspecific F -GLIBC_2.17 pthread_sigmask F GLIBC_2.17 pthread_sigqueue F GLIBC_2.17 pthread_spin_destroy F GLIBC_2.17 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile index 2e132e474b..92484bbe65 100644 --- a/sysdeps/unix/sysv/linux/alpha/Makefile +++ b/sysdeps/unix/sysv/linux/alpha/Makefile @@ -31,9 +31,9 @@ libm-routines += multc3 divtc3 endif # math ifeq ($(subdir),nptl) -# pull in __syscall_error routine, __sigprocmask, sigaction stubs. -libpthread-routines += sysdep sigprocmask rt_sigaction -libpthread-shared-only-routines += sysdep sigprocmask rt_sigaction +# pull in __syscall_error routine, sigaction stubs. +libpthread-routines += sysdep rt_sigaction +libpthread-shared-only-routines += sysdep rt_sigaction endif ifeq ($(subdir),conform) diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index e7f2174ac2..f9f5465cc1 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -891,6 +891,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index ffd443422d..cfffc5f529 100644 --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index b152c0e24a..3ed7184464 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -1517,6 +1517,7 @@ GLIBC_2.4 pthread_self F GLIBC_2.4 pthread_setcancelstate F GLIBC_2.4 pthread_setcanceltype F GLIBC_2.4 pthread_setschedparam F +GLIBC_2.4 pthread_sigmask F GLIBC_2.4 ptrace F GLIBC_2.4 ptsname F GLIBC_2.4 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index 129c64b0a7..050e799de8 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist @@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F GLIBC_2.4 pthread_setconcurrency F GLIBC_2.4 pthread_setschedprio F GLIBC_2.4 pthread_setspecific F -GLIBC_2.4 pthread_sigmask F GLIBC_2.4 pthread_spin_destroy F GLIBC_2.4 pthread_spin_init F GLIBC_2.4 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 9371927927..dcfa2227b2 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -1514,6 +1514,7 @@ GLIBC_2.4 pthread_self F GLIBC_2.4 pthread_setcancelstate F GLIBC_2.4 pthread_setcanceltype F GLIBC_2.4 pthread_setschedparam F +GLIBC_2.4 pthread_sigmask F GLIBC_2.4 ptrace F GLIBC_2.4 ptsname F GLIBC_2.4 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist index 129c64b0a7..050e799de8 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist @@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F GLIBC_2.4 pthread_setconcurrency F GLIBC_2.4 pthread_setschedprio F GLIBC_2.4 pthread_setspecific F -GLIBC_2.4 pthread_sigmask F GLIBC_2.4 pthread_spin_destroy F GLIBC_2.4 pthread_spin_init F GLIBC_2.4 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 9b3cee65bb..b1a924bd07 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -1435,6 +1435,7 @@ GLIBC_2.29 pthread_self F GLIBC_2.29 pthread_setcancelstate F GLIBC_2.29 pthread_setcanceltype F GLIBC_2.29 pthread_setschedparam F +GLIBC_2.29 pthread_sigmask F GLIBC_2.29 ptrace F GLIBC_2.29 ptsname F GLIBC_2.29 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist index 8b72528819..977905a839 100644 --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist @@ -166,7 +166,6 @@ GLIBC_2.29 pthread_setconcurrency F GLIBC_2.29 pthread_setname_np F GLIBC_2.29 pthread_setschedprio F GLIBC_2.29 pthread_setspecific F -GLIBC_2.29 pthread_sigmask F GLIBC_2.29 pthread_sigqueue F GLIBC_2.29 pthread_spin_destroy F GLIBC_2.29 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index df6d96fbae..0812c5606b 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -1274,6 +1274,7 @@ GLIBC_2.2 pthread_self F GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setschedparam F +GLIBC_2.2 pthread_sigmask F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F GLIBC_2.2 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index 84fa775d95..558d3f0dfd 100644 --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setconcurrency F GLIBC_2.2 pthread_setspecific F -GLIBC_2.2 pthread_sigmask F GLIBC_2.2 pthread_spin_destroy F GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index fcb625b6bf..661a647f06 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -868,6 +868,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index 4727bd5d43..f13fdce3a8 100644 --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index cb556c5998..d05204d5a2 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1295,6 +1295,7 @@ GLIBC_2.2 pthread_self F GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setschedparam F +GLIBC_2.2 pthread_sigmask F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F GLIBC_2.2 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist index 3d947a66aa..0c96fc3ccb 100644 --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setconcurrency F GLIBC_2.2 pthread_setspecific F -GLIBC_2.2 pthread_sigmask F GLIBC_2.2 pthread_spin_destroy F GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c index 93d1d66dd0..d9ed942963 100644 --- a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c +++ b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c @@ -34,8 +34,7 @@ __libc_unwind_longjmp (sigjmp_buf env, int val) if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ - (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, - (sigset_t *) NULL); + __libc_signal_restore_set (&env[0].__saved_mask); /* Call the machine-dependent function to restore machine state. */ __sigstack_longjmp (env[0].__jmpbuf, val ?: 1); diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 5e3cdea246..1ea3f2c4e0 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -1497,6 +1497,7 @@ GLIBC_2.4 pthread_self F GLIBC_2.4 pthread_setcancelstate F GLIBC_2.4 pthread_setcanceltype F GLIBC_2.4 pthread_setschedparam F +GLIBC_2.4 pthread_sigmask F GLIBC_2.4 ptrace F GLIBC_2.4 ptsname F GLIBC_2.4 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist index 129c64b0a7..050e799de8 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist @@ -186,7 +186,6 @@ GLIBC_2.4 pthread_setcanceltype F GLIBC_2.4 pthread_setconcurrency F GLIBC_2.4 pthread_setschedprio F GLIBC_2.4 pthread_setspecific F -GLIBC_2.4 pthread_sigmask F GLIBC_2.4 pthread_spin_destroy F GLIBC_2.4 pthread_spin_init F GLIBC_2.4 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index ea5e7a41af..b0dd9f0b1a 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -867,6 +867,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index 4727bd5d43..f13fdce3a8 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index ac55b0acd7..f51badd76b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -1450,6 +1450,7 @@ GLIBC_2.18 pthread_self F GLIBC_2.18 pthread_setcancelstate F GLIBC_2.18 pthread_setcanceltype F GLIBC_2.18 pthread_setschedparam F +GLIBC_2.18 pthread_sigmask F GLIBC_2.18 ptrace F GLIBC_2.18 ptsname F GLIBC_2.18 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist index 78885c05cf..87bd3ad30e 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist @@ -158,7 +158,6 @@ GLIBC_2.18 pthread_setconcurrency F GLIBC_2.18 pthread_setname_np F GLIBC_2.18 pthread_setschedprio F GLIBC_2.18 pthread_setspecific F -GLIBC_2.18 pthread_sigmask F GLIBC_2.18 pthread_sigqueue F GLIBC_2.18 pthread_spin_destroy F GLIBC_2.18 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index f7ced487f7..3436dcac24 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -1450,6 +1450,7 @@ GLIBC_2.18 pthread_self F GLIBC_2.18 pthread_setcancelstate F GLIBC_2.18 pthread_setcanceltype F GLIBC_2.18 pthread_setschedparam F +GLIBC_2.18 pthread_sigmask F GLIBC_2.18 ptrace F GLIBC_2.18 ptsname F GLIBC_2.18 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist index 78885c05cf..87bd3ad30e 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist @@ -158,7 +158,6 @@ GLIBC_2.18 pthread_setconcurrency F GLIBC_2.18 pthread_setname_np F GLIBC_2.18 pthread_setschedprio F GLIBC_2.18 pthread_setspecific F -GLIBC_2.18 pthread_sigmask F GLIBC_2.18 pthread_sigqueue F GLIBC_2.18 pthread_spin_destroy F GLIBC_2.18 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 06c2e64edd..5d442b5ea0 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index 62f7a3f349..474ed999b3 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index bdfd073b86..33ca075b39 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist index 62f7a3f349..474ed999b3 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 3d61d4974a..858fa545ef 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -864,6 +864,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 675acca5db..5468e89138 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -862,6 +862,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 7fec0c9670..d4c4e03f9c 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -1492,6 +1492,7 @@ GLIBC_2.21 pthread_self F GLIBC_2.21 pthread_setcancelstate F GLIBC_2.21 pthread_setcanceltype F GLIBC_2.21 pthread_setschedparam F +GLIBC_2.21 pthread_sigmask F GLIBC_2.21 ptrace F GLIBC_2.21 ptsname F GLIBC_2.21 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist index 45ebcf5a6c..fb9c4a178a 100644 --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist @@ -158,7 +158,6 @@ GLIBC_2.21 pthread_setconcurrency F GLIBC_2.21 pthread_setname_np F GLIBC_2.21 pthread_setschedprio F GLIBC_2.21 pthread_setspecific F -GLIBC_2.21 pthread_sigmask F GLIBC_2.21 pthread_sigqueue F GLIBC_2.21 pthread_spin_destroy F GLIBC_2.21 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 1e8ff6f83e..a1bee424d6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -875,6 +875,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index 2f4ed55693..65a9ef573e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 0c86217fc6..f4de9af6d6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -1380,6 +1380,7 @@ GLIBC_2.3 pthread_self F GLIBC_2.3 pthread_setcancelstate F GLIBC_2.3 pthread_setcanceltype F GLIBC_2.3 pthread_setschedparam F +GLIBC_2.3 pthread_sigmask F GLIBC_2.3 ptrace F GLIBC_2.3 ptsname F GLIBC_2.3 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist index f4d34b1c47..fe5bf9fd47 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist @@ -157,7 +157,6 @@ GLIBC_2.3 pthread_setcancelstate F GLIBC_2.3 pthread_setcanceltype F GLIBC_2.3 pthread_setconcurrency F GLIBC_2.3 pthread_setspecific F -GLIBC_2.3 pthread_sigmask F GLIBC_2.3 pthread_spin_destroy F GLIBC_2.3 pthread_spin_init F GLIBC_2.3 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 2229a1dcc0..9c1ed64483 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -1536,6 +1536,7 @@ GLIBC_2.17 pthread_self F GLIBC_2.17 pthread_setcancelstate F GLIBC_2.17 pthread_setcanceltype F GLIBC_2.17 pthread_setschedparam F +GLIBC_2.17 pthread_sigmask F GLIBC_2.17 ptrace F GLIBC_2.17 ptsname F GLIBC_2.17 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist index d65beba958..48b368acb1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist @@ -156,7 +156,6 @@ GLIBC_2.17 pthread_setconcurrency F GLIBC_2.17 pthread_setname_np F GLIBC_2.17 pthread_setschedprio F GLIBC_2.17 pthread_setspecific F -GLIBC_2.17 pthread_sigmask F GLIBC_2.17 pthread_sigqueue F GLIBC_2.17 pthread_spin_destroy F GLIBC_2.17 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 31010e6cf7..e2e0861cb2 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -1438,6 +1438,7 @@ GLIBC_2.27 pthread_self F GLIBC_2.27 pthread_setcancelstate F GLIBC_2.27 pthread_setcanceltype F GLIBC_2.27 pthread_setschedparam F +GLIBC_2.27 pthread_sigmask F GLIBC_2.27 ptrace F GLIBC_2.27 ptsname F GLIBC_2.27 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist index 5610e51e10..44e3719991 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist @@ -155,7 +155,6 @@ GLIBC_2.27 pthread_setconcurrency F GLIBC_2.27 pthread_setname_np F GLIBC_2.27 pthread_setschedprio F GLIBC_2.27 pthread_setspecific F -GLIBC_2.27 pthread_sigmask F GLIBC_2.27 pthread_sigqueue F GLIBC_2.27 pthread_spin_destroy F GLIBC_2.27 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 4feca641b0..e45a5af0bc 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -866,6 +866,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index 80ad434007..0b2913ba2b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index efe588a072..b357b9bce8 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1292,6 +1292,7 @@ GLIBC_2.2 pthread_self F GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setschedparam F +GLIBC_2.2 pthread_sigmask F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F GLIBC_2.2 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist index daef2b5cd5..8c71cdc48d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist @@ -138,7 +138,6 @@ GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setconcurrency F GLIBC_2.2 pthread_setspecific F -GLIBC_2.2 pthread_sigmask F GLIBC_2.2 pthread_spin_destroy F GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 6bfc2b7439..f5cffdd0fc 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -1278,6 +1278,7 @@ GLIBC_2.2 pthread_self F GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setschedparam F +GLIBC_2.2 pthread_sigmask F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F GLIBC_2.2 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index 84fa775d95..558d3f0dfd 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setconcurrency F GLIBC_2.2 pthread_setspecific F -GLIBC_2.2 pthread_sigmask F GLIBC_2.2 pthread_spin_destroy F GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 4b057bf4a2..5ecd1fd1d7 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -1278,6 +1278,7 @@ GLIBC_2.2 pthread_self F GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setschedparam F +GLIBC_2.2 pthread_sigmask F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F GLIBC_2.2 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index 84fa775d95..558d3f0dfd 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setconcurrency F GLIBC_2.2 pthread_setspecific F -GLIBC_2.2 pthread_sigmask F GLIBC_2.2 pthread_spin_destroy F GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 49cd597fd6..40c0f002ff 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -869,6 +869,7 @@ GLIBC_2.0 pthread_self F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setschedparam F +GLIBC_2.0 pthread_sigmask F GLIBC_2.0 ptrace F GLIBC_2.0 putc F GLIBC_2.0 putc_unlocked F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index ffd443422d..cfffc5f529 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist @@ -71,7 +71,6 @@ GLIBC_2.0 pthread_once F GLIBC_2.0 pthread_setcancelstate F GLIBC_2.0 pthread_setcanceltype F GLIBC_2.0 pthread_setspecific F -GLIBC_2.0 pthread_sigmask F GLIBC_2.0 pthread_testcancel F GLIBC_2.0 raise F GLIBC_2.0 read F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 95e68e0ba1..5195921a50 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1321,6 +1321,7 @@ GLIBC_2.2 pthread_self F GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setschedparam F +GLIBC_2.2 pthread_sigmask F GLIBC_2.2 ptrace F GLIBC_2.2 ptsname F GLIBC_2.2 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist index 3d947a66aa..0c96fc3ccb 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist @@ -136,7 +136,6 @@ GLIBC_2.2 pthread_setcancelstate F GLIBC_2.2 pthread_setcanceltype F GLIBC_2.2 pthread_setconcurrency F GLIBC_2.2 pthread_setspecific F -GLIBC_2.2 pthread_sigmask F GLIBC_2.2 pthread_spin_destroy F GLIBC_2.2 pthread_spin_init F GLIBC_2.2 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 1f2dbd1451..f17500e13a 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1288,6 +1288,7 @@ GLIBC_2.2.5 pthread_self F GLIBC_2.2.5 pthread_setcancelstate F GLIBC_2.2.5 pthread_setcanceltype F GLIBC_2.2.5 pthread_setschedparam F +GLIBC_2.2.5 pthread_sigmask F GLIBC_2.2.5 ptrace F GLIBC_2.2.5 ptsname F GLIBC_2.2.5 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist index a6bc9f4a55..2888c3150b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist @@ -137,7 +137,6 @@ GLIBC_2.2.5 pthread_setcancelstate F GLIBC_2.2.5 pthread_setcanceltype F GLIBC_2.2.5 pthread_setconcurrency F GLIBC_2.2.5 pthread_setspecific F -GLIBC_2.2.5 pthread_sigmask F GLIBC_2.2.5 pthread_spin_destroy F GLIBC_2.2.5 pthread_spin_init F GLIBC_2.2.5 pthread_spin_lock F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 59da85a5d8..6a98f8e7ea 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -1455,6 +1455,7 @@ GLIBC_2.16 pthread_self F GLIBC_2.16 pthread_setcancelstate F GLIBC_2.16 pthread_setcanceltype F GLIBC_2.16 pthread_setschedparam F +GLIBC_2.16 pthread_sigmask F GLIBC_2.16 ptrace F GLIBC_2.16 ptsname F GLIBC_2.16 ptsname_r F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist index 17f6ec438f..5ac72e4515 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist @@ -156,7 +156,6 @@ GLIBC_2.16 pthread_setconcurrency F GLIBC_2.16 pthread_setname_np F GLIBC_2.16 pthread_setschedprio F GLIBC_2.16 pthread_setspecific F -GLIBC_2.16 pthread_sigmask F GLIBC_2.16 pthread_sigqueue F GLIBC_2.16 pthread_spin_destroy F GLIBC_2.16 pthread_spin_init F From patchwork Thu Mar 12 20:54:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 38535 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by sourceware.org (Postfix) with ESMTPS id B15023877021 for ; Thu, 12 Mar 2020 20:54:31 +0000 (GMT) Received: by mail-qv1-xf42.google.com with SMTP id w5so3388292qvp.11 for ; Thu, 12 Mar 2020 13:54:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=QgC9R9v+zVhRKsEh4xYjvFc6R11q3Ksl9Zot+eMBQHE=; b=dIxdmHi036y1G5ix9q9fMrnLua+lPmuwrmM8IR6HWEA5TgowNxmFoPTXtGY8rjuyxM d9oBPyt+uIgZ6cO0t2JIi89tWBGX0UzpYQ/dsms+mID0vc7eJq+BmUHjKlNvMoVeX/c5 4tEvOvdUncjlbEcdwpiZKafbk5wbNJEY2o7Z7EOFCiHfaM8fh4jpoh7R9M/vwDSU3Zh2 helNl0MhQd4HdQJDg2s/uDujQoTXdZPxUkl/i21WAXKVJT3zO638sR7ETK78ExNHMSDS FSf+cUbhcgqkj/zfC6XyM8NFoXY2pu/olMI+bIVRKZ7b37fBbjlzBvUY/1c2ajFk/s5A asKA== X-Gm-Message-State: ANhLgQ0/c3Q9667M0JdecYL5BrMJpRElqD4VpAojwlIz3c0S+j+zvDiw o4ynGslIH9VAk4mftcq5RYpfNBafKOo= X-Google-Smtp-Source: ADFU+vuja5K8yxThIxYEx72IGe9jvGH67ce/rniK3l3/L1kDhb9kHCYXV2YmazLfYIMd1cIm9l9QfQ== X-Received: by 2002:a05:6214:1351:: with SMTP id b17mr9393329qvw.251.1584046471059; Thu, 12 Mar 2020 13:54:31 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id k11sm27862246qti.68.2020.03.12.13.54.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 13:54:30 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/3] linux: Use pthread_sigmask on sigprocmask Date: Thu, 12 Mar 2020 17:54:23 -0300 Message-Id: <20200312205424.17101-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200312205424.17101-1-adhemerval.zanella@linaro.org> References: <20200312205424.17101-1-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-27.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2020 20:54:32 -0000 With pthread_sigmask on libc.so, it allows consolidate both implementations. Checked on x86_64-linux-gnu. --- nptl/pthreadP.h | 3 +++ nptl/pthread_sigmask.c | 4 +++- sysdeps/unix/sysv/linux/sigprocmask.c | 20 +++++--------------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 06fb0d74c5..c6d8fc69be 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -482,6 +482,9 @@ extern void __pthread_testcancel (void); extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t, const struct timespec *, bool) attribute_hidden; +extern int __pthread_sigmask (int how, const sigset_t *newmask, + sigset_t *oldmask); +libc_hidden_proto (__pthread_sigmask) #if IS_IN (libpthread) diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c index c7860e02a5..9c7e9e270a 100644 --- a/nptl/pthread_sigmask.c +++ b/nptl/pthread_sigmask.c @@ -23,7 +23,7 @@ int -pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) +__pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) { sigset_t local_newmask; @@ -47,3 +47,5 @@ pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) ? INTERNAL_SYSCALL_ERRNO (result) : 0); } +libc_hidden_def (__pthread_sigmask) +weak_alias (__pthread_sigmask, pthread_sigmask) diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c index eb9e4d5e83..6ed0ab1e6a 100644 --- a/sysdeps/unix/sysv/linux/sigprocmask.c +++ b/sysdeps/unix/sysv/linux/sigprocmask.c @@ -22,21 +22,11 @@ int __sigprocmask (int how, const sigset_t *set, sigset_t *oset) { - sigset_t local_newmask; - - /* The only thing we have to make sure here is that SIGCANCEL and - SIGSETXID are not blocked. */ - if (set != NULL - && __glibc_unlikely (__sigismember (set, SIGCANCEL) - || __glibc_unlikely (__sigismember (set, SIGSETXID)))) - { - local_newmask = *set; - __sigdelset (&local_newmask, SIGCANCEL); - __sigdelset (&local_newmask, SIGSETXID); - set = &local_newmask; - } - - return INLINE_SYSCALL_CALL (rt_sigprocmask, how, set, oset, _NSIG / 8); + int result = __pthread_sigmask (how, set, oset); + if (result == 0) + return 0; + __set_errno (result); + return result; } libc_hidden_def (__sigprocmask) weak_alias (__sigprocmask, sigprocmask) From patchwork Thu Mar 12 20:54:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 38537 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by sourceware.org (Postfix) with ESMTPS id 537ED3877025 for ; Thu, 12 Mar 2020 20:54:33 +0000 (GMT) Received: by mail-qv1-xf41.google.com with SMTP id fc12so3402438qvb.6 for ; Thu, 12 Mar 2020 13:54:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=5eLDD+y/o4r/V8XhgOMVubqXUJEOIRPIFyJi9WawtvM=; b=fwJFNtoXBTLdUJZbrdB8ekNHI+cAElqZODdrF4oE7K2rRkvxUWCnt4nKq//FhDaBFV ART2pvjHwF9RDBmlbbb0ZLANll4NyrlLwp0BiCjw7EtzdCa59txy5KtsdaQRLfhDelJY igDzvyqAf7o2B7bL52NeNA6155K9CxCxxvRVW8wd8haRq9iiZ65F+8icuotoKauMD8MT Q7l8grX6g1I6j1/DvUbmrybzEy+AFnVZZ7xfvmZSTexcdf3lEkW32nv6vSf97FlPSiB1 DgEeuuTiO+NgiZSRzESGKL29H3FnX/VG8uf4qW9uc7/oDHO0VuEcYmY8qK10VDknheCJ 8KDA== X-Gm-Message-State: ANhLgQ2DXhHJnr2ptm1tUBhT2NlatPXxQKqhFNbN27SpScMa+KstMkC8 WfUkgysFxE4NQMZk6zw5k9ZH6j/19uo= X-Google-Smtp-Source: ADFU+vuWb0pHxUSxJheEgjp1zkGAXNyJF1OdOHeNAMgabnXlkJYqkZKDB38WyaIa5AUlTEl5IOSdiQ== X-Received: by 2002:ad4:4e73:: with SMTP id ec19mr8870561qvb.78.1584046472313; Thu, 12 Mar 2020 13:54:32 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id k11sm27862246qti.68.2020.03.12.13.54.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 13:54:31 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/3] signal: Only handle on NSIG signals on signal functions (BZ #25657) Date: Thu, 12 Mar 2020 17:54:24 -0300 Message-Id: <20200312205424.17101-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200312205424.17101-1-adhemerval.zanella@linaro.org> References: <20200312205424.17101-1-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-27.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2020 20:54:34 -0000 The upper bits of the sigset_t s not fully initialized in the signal mask calls that return information from kernel (sigprocmask, sigpending, and pthread_sigmask), since the exported sigset_t size (1024 bits) is larger than Linux support one (64 or 128 bits). It might make sigisemptyset/sigorset/sigandset fail if the mask is filled prior the call. This patch changes the internal signal function to handle up to supported Linux signal number (_NSIG), the remaining bits are untouched. Checked on x86_64-linux-gnu and i686-linux-gnu. --- nptl/Makefile | 2 +- nptl/pthread_sigmask.c | 8 +- nptl/tst-signal8.c | 62 ++++++++++++ signal/Makefile | 1 + signal/sigsetops.c | 12 +-- signal/tst-sigisemptyset.c | 95 ++++++++++++++++++ sysdeps/unix/sysv/linux/sigpending.c | 6 +- sysdeps/unix/sysv/linux/sigsetops.h | 143 +++++++++++++-------------- 8 files changed, 236 insertions(+), 93 deletions(-) create mode 100644 nptl/tst-signal8.c create mode 100644 signal/tst-sigisemptyset.c diff --git a/nptl/Makefile b/nptl/Makefile index 4816fa254e..33fa03807e 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -293,7 +293,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \ tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \ tst-flock1 tst-flock2 \ tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \ - tst-signal6 \ + tst-signal6 tst-signal8 \ tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \ tst-exit1 tst-exit2 tst-exit3 \ tst-stdio1 tst-stdio2 \ diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c index 9c7e9e270a..8d276c4c0f 100644 --- a/nptl/pthread_sigmask.c +++ b/nptl/pthread_sigmask.c @@ -16,7 +16,6 @@ License along with the GNU C Library; if not, see . */ -#include #include #include #include @@ -30,12 +29,11 @@ __pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) /* The only thing we have to make sure here is that SIGCANCEL and SIGSETXID is not blocked. */ if (newmask != NULL - && (__builtin_expect (__sigismember (newmask, SIGCANCEL), 0) - || __builtin_expect (__sigismember (newmask, SIGSETXID), 0))) + && (__glibc_unlikely (__sigismember (newmask, SIGCANCEL)) + || __glibc_unlikely (__sigismember (newmask, SIGSETXID)))) { local_newmask = *newmask; - __sigdelset (&local_newmask, SIGCANCEL); - __sigdelset (&local_newmask, SIGSETXID); + __clear_internal_signals (&local_newmask); newmask = &local_newmask; } diff --git a/nptl/tst-signal8.c b/nptl/tst-signal8.c new file mode 100644 index 0000000000..9da7e5ef07 --- /dev/null +++ b/nptl/tst-signal8.c @@ -0,0 +1,62 @@ +/* Tests for sigisemptyset and pthread_sigmask. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#include +#include + +static void * +tf (void *arg) +{ + { + sigset_t set; + sigemptyset (&set); + TEST_COMPARE (pthread_sigmask (SIG_BLOCK, 0, &set), 0); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + { + sigset_t set; + sigfillset (&set); + TEST_COMPARE (pthread_sigmask (SIG_BLOCK, 0, &set), 0); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + return NULL; +} + +static int +do_test (void) +{ + /* Ensure current SIG_BLOCK mask empty. */ + { + sigset_t set; + sigemptyset (&set); + TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0); + } + + { + pthread_t thr = xpthread_create (NULL, tf, NULL); + xpthread_join (thr); + } + + return 0; +} + +#include diff --git a/signal/Makefile b/signal/Makefile index 37de438bba..f3c19e2992 100644 --- a/signal/Makefile +++ b/signal/Makefile @@ -49,6 +49,7 @@ tests := tst-signal tst-sigset tst-sigsimple tst-raise tst-sigset2 \ tst-sigwait-eintr tst-sigaction \ tst-minsigstksz-1 tst-minsigstksz-2 tst-minsigstksz-3 \ tst-minsigstksz-3a tst-minsigstksz-4 \ + tst-sigisemptyset include ../Rules diff --git a/signal/sigsetops.c b/signal/sigsetops.c index eb89e6780e..1165377876 100644 --- a/signal/sigsetops.c +++ b/signal/sigsetops.c @@ -26,28 +26,28 @@ int attribute_compat_text_section -(__sigismember) (const __sigset_t *set, int sig) +__sigismember_compat (const __sigset_t *set, int sig) { return __sigismember (set, sig); } -compat_symbol (libc, __sigismember, __sigismember, GLIBC_2_0); +compat_symbol (libc, __sigismember_compat, __sigismember, GLIBC_2_0); int attribute_compat_text_section -(__sigaddset) (__sigset_t *set, int sig) +__sigaddset_compat (__sigset_t *set, int sig) { __sigaddset (set, sig); return 0; } -compat_symbol (libc, __sigaddset, __sigaddset, GLIBC_2_0); +compat_symbol (libc, __sigaddset_compat, __sigaddset, GLIBC_2_0); int attribute_compat_text_section -(__sigdelset) (__sigset_t *set, int sig) +__sigdelset_compat (__sigset_t *set, int sig) { __sigdelset (set, sig); return 0; } -compat_symbol (libc, __sigdelset, __sigdelset, GLIBC_2_0); +compat_symbol (libc, __sigdelset_compat, __sigdelset, GLIBC_2_0); #endif diff --git a/signal/tst-sigisemptyset.c b/signal/tst-sigisemptyset.c new file mode 100644 index 0000000000..9ed95496f2 --- /dev/null +++ b/signal/tst-sigisemptyset.c @@ -0,0 +1,95 @@ +/* Tests for sigisemptyset/sigorset/sigandset. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#include + +static int +do_test (void) +{ + { + sigset_t set; + sigemptyset (&set); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + { + sigset_t set; + sigfillset (&set); + TEST_COMPARE (sigisemptyset (&set), 0); + } + + { + sigset_t setfill, setempty, set; + sigfillset (&setfill); + sigemptyset (&setempty); + + sigorset (&set, &setfill, &setempty); + TEST_COMPARE (sigisemptyset (&set), 0); + + sigandset (&set, &setfill, &setempty); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + /* Ensure current SIG_BLOCK mask empty. */ + { + sigset_t set; + sigemptyset (&set); + TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0); + } + + { + sigset_t set; + sigemptyset (&set); + TEST_COMPARE (sigprocmask (SIG_BLOCK, 0, &set), 0); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + { + sigset_t set; + sigfillset (&set); + TEST_COMPARE (sigprocmask (SIG_BLOCK, 0, &set), 0); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + /* Block all signals. */ + { + sigset_t set; + sigfillset (&set); + TEST_COMPARE (sigprocmask (SIG_BLOCK, &set, 0), 0); + } + + { + sigset_t set; + sigemptyset (&set); + TEST_COMPARE (sigpending (&set), 0); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + { + sigset_t set; + sigfillset (&set); + TEST_COMPARE (sigpending (&set), 0); + TEST_COMPARE (sigisemptyset (&set), 1); + } + + return 0; +} + +#include diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c index f6bedb5182..458a3cf99e 100644 --- a/sysdeps/unix/sysv/linux/sigpending.c +++ b/sysdeps/unix/sysv/linux/sigpending.c @@ -15,13 +15,9 @@ License along with the GNU C Library; if not, see . */ -#include #include -#include - #include -#include - +#include /* Change the set of blocked signals to SET, wait until a signal arrives, and restore the set of blocked signals. */ diff --git a/sysdeps/unix/sysv/linux/sigsetops.h b/sysdeps/unix/sysv/linux/sigsetops.h index cb97c98b10..f6ca34c842 100644 --- a/sysdeps/unix/sysv/linux/sigsetops.h +++ b/sysdeps/unix/sysv/linux/sigsetops.h @@ -28,81 +28,72 @@ /* Return the word index for SIG. */ # define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) -# define __sigemptyset(set) \ - (__extension__ ({ \ - int __cnt = _SIGSET_NWORDS; \ - sigset_t *__set = (set); \ - while (--__cnt >= 0) \ - __set->__val[__cnt] = 0; \ - (void)0; \ - })) - -# define __sigfillset(set) \ - (__extension__ ({ \ - int __cnt = _SIGSET_NWORDS; \ - sigset_t *__set = (set); \ - while (--__cnt >= 0) \ - __set->__val[__cnt] = ~0UL; \ - (void)0; \ - })) - -# define __sigisemptyset(set) \ - (__extension__ ({ \ - int __cnt = _SIGSET_NWORDS; \ - const sigset_t *__set = (set); \ - int __ret = __set->__val[--__cnt]; \ - while (!__ret && --__cnt >= 0) \ - __ret = __set->__val[__cnt]; \ - __ret == 0; \ - })) - -# define __sigandset(dest, left, right) \ - (__extension__ ({ \ - int __cnt = _SIGSET_NWORDS; \ - sigset_t *__dest = (dest); \ - const sigset_t *__left = (left); \ - const sigset_t *__right = (right); \ - while (--__cnt >= 0) \ - __dest->__val[__cnt] = (__left->__val[__cnt] \ - & __right->__val[__cnt]); \ - (void)0; \ - })) - -# define __sigorset(dest, left, right) \ - (__extension__ ({ \ - int __cnt = _SIGSET_NWORDS; \ - sigset_t *__dest = (dest); \ - const sigset_t *__left = (left); \ - const sigset_t *__right = (right); \ - while (--__cnt >= 0) \ - __dest->__val[__cnt] = (__left->__val[__cnt] \ - | __right->__val[__cnt]); \ - (void)0; \ - })) - -/* These macros needn't check for a bogus signal number; - error checking is done in the non-__ versions. */ -# define __sigismember(set, sig) \ - (__extension__ ({ \ - unsigned long int __mask = __sigmask (sig); \ - unsigned long int __word = __sigword (sig); \ - (set)->__val[__word] & __mask ? 1 : 0; \ - })) - -# define __sigaddset(set, sig) \ - (__extension__ ({ \ - unsigned long int __mask = __sigmask (sig); \ - unsigned long int __word = __sigword (sig); \ - (set)->__val[__word] |= __mask; \ - (void)0; \ - })) - -# define __sigdelset(set, sig) \ - (__extension__ ({ \ - unsigned long int __mask = __sigmask (sig); \ - unsigned long int __word = __sigword (sig); \ - (set)->__val[__word] &= ~__mask; \ - (void)0; \ - })) +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int ))) + +static inline void +__sigemptyset (sigset_t *set) +{ + int cnt = __NSIG_WORDS; + while (--cnt >= 0) + set->__val[cnt] = 0; +} + +static inline void +__sigfillset (sigset_t *set) +{ + int cnt = __NSIG_WORDS; + while (--cnt >= 0) + set->__val[cnt] = ~0UL; +} + +static inline int +__sigisemptyset (const sigset_t *set) +{ + int cnt = __NSIG_WORDS; + int ret = set->__val[--cnt]; + while (ret == 0 && --cnt >= 0) + ret = set->__val[cnt]; + return ret == 0; +} + +static inline void +__sigandset (sigset_t *dest, const sigset_t *left, const sigset_t *right) +{ + int cnt = __NSIG_WORDS; + while (--cnt >= 0) + dest->__val[cnt] = left->__val[cnt] & right->__val[cnt]; +} + +static inline void +__sigorset (sigset_t *dest, const sigset_t *left, const sigset_t *right) +{ + int cnt = __NSIG_WORDS; + while (--cnt >= 0) + dest->__val[cnt] = left->__val[cnt] | right->__val[cnt]; +} + +static inline int +__sigismember (const sigset_t *set, int sig) +{ + unsigned long int mask = __sigmask (sig); + unsigned long int word = __sigword (sig); + return set->__val[word] & mask ? 1 : 0; +} + +static inline void +__sigaddset (sigset_t *set, int sig) +{ + unsigned long int mask = __sigmask (sig); + unsigned long int word = __sigword (sig); + set->__val[word] |= mask; +} + +static inline void +__sigdelset (sigset_t *set, int sig) +{ + unsigned long int mask = __sigmask (sig); + unsigned long int word = __sigword (sig); + set->__val[word] &= ~mask; +} #endif /* bits/sigsetops.h */