From patchwork Tue Jul 15 22:50:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 2068 Received: (qmail 28921 invoked by alias); 15 Jul 2014 22:50:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28907 invoked by uid 89); 15 Jul 2014 22:50:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] Add generic/stub implementations of pthread_{kill, sigmask, sigqueue}. Message-Id: <20140715225007.ED1FE2C3990@topped-with-meat.com> Date: Tue, 15 Jul 2014 15:50:07 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=FIeSFqgg-gYA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=mDV3o1hIAAAA:8 a=jz4oQAE0OmiNjKiHW1QA:9 a=CjuIK1q_8ugA:10 This does not affect existing configurations. * nptl/pthread_kill.c: New file. * nptl/pthread_sigmask.c: New file. * nptl/pthread_sigqueue.c: New file. --- /dev/null +++ b/nptl/pthread_kill.c @@ -0,0 +1,38 @@ +/* Send a signal to a specific pthread. Stub version. + Copyright (C) 2014 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 + + +int +__pthread_kill (pthread_t threadid, int signo) +{ + struct pthread *pd = (struct pthread *) threadid; + + /* Make sure the descriptor is valid. */ + if (DEBUGGING_P && INVALID_TD_P (pd)) + /* Not a valid thread handle. */ + return ESRCH; + + return ENOSYS; +} +strong_alias (__pthread_kill, pthread_kill) + +stub_warning (pthread_kill) --- /dev/null +++ b/nptl/pthread_sigmask.c @@ -0,0 +1,32 @@ +/* Examine and change blocked signals for a thread. Generic POSIX version. + Copyright (C) 2014 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 + + +int +pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) +{ + /* Here we assume that sigprocmask actually does everything right. + The only difference is the return value protocol. */ + int result = __sigprocmask (how, newmask, oldmask); + if (result < 0) + result = errno; + return result; +} --- /dev/null +++ b/nptl/pthread_sigqueue.c @@ -0,0 +1,37 @@ +/* Queue a signal (with value) for a specific pthread. Stub version. + Copyright (C) 2014 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 + + +int +pthread_sigqueue (pthread_t threadid, int signo, const union sigval value) +{ + struct pthread *pd = (struct pthread *) threadid; + + /* Make sure the descriptor is valid. */ + if (DEBUGGING_P && INVALID_TD_P (pd)) + /* Not a valid thread handle. */ + return ESRCH; + + return ENOSYS; +} + +stub_warning (pthread_sigqueue)