From 9853bd1c8727b9aa54a76cbde105674b8f612dd5 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 20 Aug 2015 23:27:46 +0200 Subject: Remove more unused signals implementation * sysdeps/generic/killpg.c: Remove file. * sysdeps/generic/sigaddset.c: Likewise. * sysdeps/generic/sigdelset.c: Likewise. * sysdeps/generic/sigemptyset.c: Likewise. * sysdeps/generic/sigfillset.c: Likewise. * sysdeps/generic/siginterrupt.c: Likewise. * sysdeps/generic/sigismember.c: Likewise. * sysdeps/generic/signal.c: Likewise. * sysdeps/generic/sigwait.c: Likewise. --- sysdeps/generic/killpg.c | 27 -------------------------- sysdeps/generic/sigaddset.c | 35 --------------------------------- sysdeps/generic/sigdelset.c | 35 --------------------------------- sysdeps/generic/sigemptyset.c | 29 ---------------------------- sysdeps/generic/sigfillset.c | 29 ---------------------------- sysdeps/generic/siginterrupt.c | 36 ---------------------------------- sysdeps/generic/sigismember.c | 36 ---------------------------------- sysdeps/generic/signal.c | 44 ------------------------------------------ sysdeps/generic/sigwait.c | 34 -------------------------------- 9 files changed, 305 deletions(-) delete mode 100644 sysdeps/generic/killpg.c delete mode 100644 sysdeps/generic/sigaddset.c delete mode 100644 sysdeps/generic/sigdelset.c delete mode 100644 sysdeps/generic/sigemptyset.c delete mode 100644 sysdeps/generic/sigfillset.c delete mode 100644 sysdeps/generic/siginterrupt.c delete mode 100644 sysdeps/generic/sigismember.c delete mode 100644 sysdeps/generic/signal.c delete mode 100644 sysdeps/generic/sigwait.c (limited to 'sysdeps') diff --git a/sysdeps/generic/killpg.c b/sysdeps/generic/killpg.c deleted file mode 100644 index 7f7ed87..0000000 --- a/sysdeps/generic/killpg.c +++ /dev/null @@ -1,27 +0,0 @@ -/* killpg.c - Generic killpg implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include "sig-internal.h" - -int -killpg (pid_t pid, int sig) -{ - return kill (-pid, sig); -} diff --git a/sysdeps/generic/sigaddset.c b/sysdeps/generic/sigaddset.c deleted file mode 100644 index 14edb71..0000000 --- a/sysdeps/generic/sigaddset.c +++ /dev/null @@ -1,35 +0,0 @@ -/* sigaddset.c - Generic sigaddset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include "sig-internal.h" - -int -sigaddset (sigset_t *sigset, int signo) -{ - if (signo <= 0 || signo >= NSIG) - { - errno = EINVAL; - return -1; - } - - *sigset |= sigmask (signo); - return 0; -} - diff --git a/sysdeps/generic/sigdelset.c b/sysdeps/generic/sigdelset.c deleted file mode 100644 index 5456467..0000000 --- a/sysdeps/generic/sigdelset.c +++ /dev/null @@ -1,35 +0,0 @@ -/* sigdelset.c - Generic sigdelset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include "sig-internal.h" - -int -sigdelset (sigset_t *sigset, int signo) -{ - if (signo <= 0 || signo >= NSIG) - { - errno = EINVAL; - return -1; - } - - *sigset &= ~sigmask (signo); - return 0; -} - diff --git a/sysdeps/generic/sigemptyset.c b/sysdeps/generic/sigemptyset.c deleted file mode 100644 index 690c15b..0000000 --- a/sysdeps/generic/sigemptyset.c +++ /dev/null @@ -1,29 +0,0 @@ -/* sigemptyset.c - Generic sigemptyset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include - -int -sigemptyset (sigset_t *sigset) -{ - *sigset = 0; - return 0; -} - diff --git a/sysdeps/generic/sigfillset.c b/sysdeps/generic/sigfillset.c deleted file mode 100644 index f0ac078..0000000 --- a/sysdeps/generic/sigfillset.c +++ /dev/null @@ -1,29 +0,0 @@ -/* sigfillset.c - Generic sigfillset implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include - -int -sigfillset (sigset_t *sigset) -{ - *sigset = (1ULL << (NSIG - 1)) - 1; - return 0; -} - diff --git a/sysdeps/generic/siginterrupt.c b/sysdeps/generic/siginterrupt.c deleted file mode 100644 index 0899efb..0000000 --- a/sysdeps/generic/siginterrupt.c +++ /dev/null @@ -1,36 +0,0 @@ -/* siginterrupt.c - Generic siginterrupt implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include "sig-internal.h" - -int -siginterrupt (int sig, int flag) -{ - int ret; - struct sigaction act; - - sigaction (sig, NULL, &act); - if (flag) - act.sa_flags &= ~SA_RESTART; - else - act.sa_flags |= SA_RESTART; - ret = sigaction(sig, &act, NULL); - return ret; -} diff --git a/sysdeps/generic/sigismember.c b/sysdeps/generic/sigismember.c deleted file mode 100644 index b3d65c9..0000000 --- a/sysdeps/generic/sigismember.c +++ /dev/null @@ -1,36 +0,0 @@ -/* sigismember.c - Generic sigismember implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include "sig-internal.h" - -int -sigismember (const sigset_t *sigset, int signo) -{ - if (signo <= 0 || signo >= NSIG) - { - errno = EINVAL; - return -1; - } - - if (*sigset & sigmask (signo)) - return 1; - else - return 0; -} diff --git a/sysdeps/generic/signal.c b/sysdeps/generic/signal.c deleted file mode 100644 index 7555d0a..0000000 --- a/sysdeps/generic/signal.c +++ /dev/null @@ -1,44 +0,0 @@ -/* signal.c - Generic signal implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include "sig-internal.h" - -void (*signal (int sig, void (*handler)(int)))(int) -{ - struct sigaction sa; - - sa.sa_handler = handler; - sa.sa_flags = SA_RESTART; - - if (sigemptyset (&sa.sa_mask) < 0 - || sigaddset (&sa.sa_mask, sig) < 0) - return SIG_ERR; - - struct sigaction osa; - if (sigaction (sig, &sa, &osa) < 0) - return SIG_ERR; - - return osa.sa_handler; -} - -void (*bsd_signal (int sig, void (*func)(int)))(int) -{ - return signal (sig, func); -} diff --git a/sysdeps/generic/sigwait.c b/sysdeps/generic/sigwait.c deleted file mode 100644 index 7d10bf8..0000000 --- a/sysdeps/generic/sigwait.c +++ /dev/null @@ -1,34 +0,0 @@ -/* sigwait.c - Generic sigwait implementation. - Copyright (C) 2008 Free Software Foundation, Inc. - Written by Neal H. Walfield . - - This file is part of the GNU Hurd. - - The GNU Hurd 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 3 of - the License, or (at your option) any later version. - - The GNU Hurd 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 this program. If not, see - . */ - -#include "sig-internal.h" - -int -sigwait (const sigset_t *restrict set, int *restrict signo) -{ - siginfo_t info; - - if (sigwaitinfo (set, &info) < 0) - return -1; - - *signo = info.si_signo; - return 0; -} - -- cgit v1.2.3 From f40b1c7b5958bbf269bda7578597522e0290b4b0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 20 Aug 2015 23:30:14 +0200 Subject: Fix raise.c build * sysdeps/generic/raise.c: Include instead of non-existing "sig-internal.h" --- sysdeps/generic/raise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index 410f557..2319cfa 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -18,7 +18,7 @@ License along with this program. If not, see . */ -#include "sig-internal.h" +#include int raise (int signo) -- cgit v1.2.3 From 0a020aad03f7fd30e7ad1c830507bad6dd775a07 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 20 Aug 2015 23:50:47 +0200 Subject: Drop debugging statements * sysdeps/generic/raise.c (raise): Do not call debug. --- sysdeps/generic/raise.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index 2319cfa..7514d3b 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -27,9 +27,7 @@ raise (int signo) "the effect of the raise() function shall be equivalent to calling: pthread_kill(pthread_self(), sig);" */ -debug (0, ""); int err = pthread_kill (pthread_self (), signo); -debug (0, ""); if (err) { errno = err; -- cgit v1.2.3 From c21c653bea37117ed8b263d7714ad8b3f8b37a76 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 20 Aug 2015 23:57:54 +0200 Subject: Fix raise thread-aware implementation * sysdeps/generic/raise.c (pthread_kill): Make ref weak. (raise): Only call pthread_kill when it is not NULL. Call kill otherwise. --- sysdeps/generic/raise.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index 7514d3b..3c21233 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -20,6 +20,7 @@ #include +#pragma weak pthread_kill int raise (int signo) { @@ -27,7 +28,11 @@ raise (int signo) "the effect of the raise() function shall be equivalent to calling: pthread_kill(pthread_self(), sig);" */ - int err = pthread_kill (pthread_self (), signo); + int err; + if (pthread_kill) + err = pthread_kill (pthread_self (), signo); + else + err = __kill (__getpid (), signo); if (err) { errno = err; -- cgit v1.2.3 From a30d42b4b85309ed6480d0a03dcf60e2e74fe607 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 28 Aug 2015 02:17:52 +0200 Subject: Fix spurious dependency of libc on libpthread * sysdeps/generic/raise.c (pthread_self): Make reference weak. --- sysdeps/generic/raise.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sysdeps') diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index 3c21233..15348ce 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -21,6 +21,7 @@ #include #pragma weak pthread_kill +#pragma weak pthread_self int raise (int signo) { -- cgit v1.2.3 From 94c8018de38eda69fdaa4130e433d95f09b7beae Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 1 Sep 2015 02:23:16 +0200 Subject: Move semaphore.h to place where glibc expects it to be * include/semaphore.h: Move to ... * sysdeps/pthread/semaphore.h: ... here. --- include/semaphore.h | 81 --------------------------------------------- sysdeps/pthread/semaphore.h | 81 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 81 deletions(-) delete mode 100644 include/semaphore.h create mode 100644 sysdeps/pthread/semaphore.h (limited to 'sysdeps') diff --git a/include/semaphore.h b/include/semaphore.h deleted file mode 100644 index 64249f6..0000000 --- a/include/semaphore.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (C) 2005, 2007 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SEMAPHORE_H -#define _SEMAPHORE_H 1 - -#include -#include -#ifdef __USE_XOPEN2K -# define __need_timespec -# include -#endif - -/* Get the definition for struct __semaphore. */ -#include - - -__BEGIN_DECLS - -#define SEM_FAILED ((void *) 0) - -typedef struct __semaphore sem_t; - -/* Initialize semaphore *SEM with value VALUE. */ -extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value) - __THROW; -/* Destroy semaphore *SEM created with sem_init. */ -extern int sem_destroy (sem_t *__sem) __THROW; - -/* Open a named semaphore. */ -extern sem_t *sem_open (const char *__name, int __oflag, ...) __THROW; - -/* Close a semaphore returned by sem_open. */ -extern int sem_close (sem_t *__sem) __THROW; - -/* Unlink a named semaphore. */ -extern int sem_unlink (const char *__name) __THROW; - -/* Perform a down operation on semaphore *SEM. - - This function is a cancellation point and therefore not marked with - __THROW. */ -extern int sem_wait (sem_t *__sem); - -#ifdef __USE_XOPEN2K -/* Perform a down operation on semaphore *SEM but don't wait longer - than TIMEOUT. */ -extern int sem_timedwait (sem_t *__restrict __sem, - const struct timespec *__restrict __abstime); -#endif - -/* Perform a down operation on semaphore *SEM if it can be done so - without blocking. */ -extern int sem_trywait (sem_t *__sem) __THROWNL; - -/* Perform an up operation on semaphore *SEM. */ -extern int sem_post (sem_t *__sem) __THROWNL; - -/* Store the value of semaphore *SEM in *VALUE. */ -extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval) - __THROW; - - -__END_DECLS - -#endif /* semaphore.h */ diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h new file mode 100644 index 0000000..64249f6 --- /dev/null +++ b/sysdeps/pthread/semaphore.h @@ -0,0 +1,81 @@ +/* Copyright (C) 2005, 2007 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SEMAPHORE_H +#define _SEMAPHORE_H 1 + +#include +#include +#ifdef __USE_XOPEN2K +# define __need_timespec +# include +#endif + +/* Get the definition for struct __semaphore. */ +#include + + +__BEGIN_DECLS + +#define SEM_FAILED ((void *) 0) + +typedef struct __semaphore sem_t; + +/* Initialize semaphore *SEM with value VALUE. */ +extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value) + __THROW; +/* Destroy semaphore *SEM created with sem_init. */ +extern int sem_destroy (sem_t *__sem) __THROW; + +/* Open a named semaphore. */ +extern sem_t *sem_open (const char *__name, int __oflag, ...) __THROW; + +/* Close a semaphore returned by sem_open. */ +extern int sem_close (sem_t *__sem) __THROW; + +/* Unlink a named semaphore. */ +extern int sem_unlink (const char *__name) __THROW; + +/* Perform a down operation on semaphore *SEM. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int sem_wait (sem_t *__sem); + +#ifdef __USE_XOPEN2K +/* Perform a down operation on semaphore *SEM but don't wait longer + than TIMEOUT. */ +extern int sem_timedwait (sem_t *__restrict __sem, + const struct timespec *__restrict __abstime); +#endif + +/* Perform a down operation on semaphore *SEM if it can be done so + without blocking. */ +extern int sem_trywait (sem_t *__sem) __THROWNL; + +/* Perform an up operation on semaphore *SEM. */ +extern int sem_post (sem_t *__sem) __THROWNL; + +/* Store the value of semaphore *SEM in *VALUE. */ +extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval) + __THROW; + + +__END_DECLS + +#endif /* semaphore.h */ -- cgit v1.2.3 From 40f99833334b930762f957763d9db06e2f5dc7bb Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 21 Sep 2015 00:04:15 +0200 Subject: Avoid exposing function prototype parameter names * include/pthread/pthread.h: Prepend '__' to parameter names. * sysdeps/mach/hurd/bits/pthread-np.h: Likewise. --- include/pthread/pthread.h | 264 ++++++++++++++++++------------------ sysdeps/mach/hurd/bits/pthread-np.h | 2 +- 2 files changed, 133 insertions(+), 133 deletions(-) (limited to 'sysdeps') diff --git a/include/pthread/pthread.h b/include/pthread/pthread.h index cd32fb2..c211001 100644 --- a/include/pthread/pthread.h +++ b/include/pthread/pthread.h @@ -79,112 +79,112 @@ __BEGIN_DECLS /* Initialize the thread attribute object in *ATTR to the default values. */ -extern int pthread_attr_init (pthread_attr_t *attr); +extern int pthread_attr_init (pthread_attr_t *__attr); /* Destroy the thread attribute object in *ATTR. */ -extern int pthread_attr_destroy (pthread_attr_t *attr); +extern int pthread_attr_destroy (pthread_attr_t *__attr); /* Return the value of the inheritsched attribute in *ATTR in *INHERITSCHED. */ -extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict attr, - int *__restrict inheritsched); +extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, + int *__restrict __inheritsched); /* Set the value of the inheritsched attribute in *ATTR to INHERITSCHED. */ -extern int pthread_attr_setinheritsched (pthread_attr_t *attr, - int inheritsched); +extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, + int __inheritsched); /* Return the value of the schedparam attribute in *ATTR in *PARAM. */ -extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict attr, - struct sched_param *__restrict param); +extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, + struct sched_param *__restrict __param); /* Set the value of the schedparam attribute in *ATTR to PARAM. */ -extern int pthread_attr_setschedparam (pthread_attr_t *__restrict attr, - const struct sched_param *__restrict param); +extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, + const struct sched_param *__restrict __param); /* Return the value of the schedpolicy attribute in *ATTR to *POLICY. */ -extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict attr, - int *__restrict policy); +extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, + int *__restrict __policy); /* Set the value of the schedpolicy attribute in *ATTR to POLICY. */ -extern int pthread_attr_setschedpolicy (pthread_attr_t *attr, - int policy); +extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, + int __policy); /* Return the value of the contentionscope attribute in *ATTR in *CONTENTIONSCOPE. */ -extern int pthread_attr_getscope (const pthread_attr_t *__restrict attr, - int *__restrict contentionscope); +extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, + int *__restrict __contentionscope); /* Set the value of the contentionscope attribute in *ATTR to CONTENTIONSCOPE. */ -extern int pthread_attr_setscope (pthread_attr_t *attr, - int contentionscope); +extern int pthread_attr_setscope (pthread_attr_t *__attr, + int __contentionscope); /* Return the value of the stackaddr attribute in *ATTR in *STACKADDR. */ -extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict attr, - void **__restrict stackaddr); +extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr); /* Set the value of the stackaddr attribute in *ATTR to STACKADDR. */ -extern int pthread_attr_setstackaddr (pthread_attr_t *attr, - void *stackaddr); +extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, + void *__stackaddr); #ifdef __USE_XOPEN2K /* Return the value of the stackaddr and stacksize attributes in *ATTR in *STACKADDR and *STACKSIZE respectively. */ -extern int pthread_attr_getstack (const pthread_attr_t *__restrict attr, - void **__restrict stackaddr, - size_t *__restrict stacksize); +extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr, + size_t *__restrict __stacksize); /* Set the value of the stackaddr and stacksize attributes in *ATTR to STACKADDR and STACKSIZE respectively. */ -extern int pthread_attr_setstack (pthread_attr_t *attr, - void *stackaddr, - size_t stacksize); +extern int pthread_attr_setstack (pthread_attr_t *__attr, + void *__stackaddr, + size_t __stacksize); #endif /* Return the value of the detachstate attribute in *ATTR in *DETACHSTATE. */ -extern int pthread_attr_getdetachstate (const pthread_attr_t *attr, - int *detachstate); +extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, + int *__detachstate); /* Set the value of the detachstate attribute in *ATTR to DETACHSTATE. */ -extern int pthread_attr_setdetachstate (pthread_attr_t *attr, - int detachstate); +extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, + int __detachstate); /* Return the value of the guardsize attribute in *ATTR in *GUARDSIZE. */ -extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict attr, - size_t *__restrict guardsize); +extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr, + size_t *__restrict __guardsize); /* Set the value of the guardsize attribute in *ATTR to GUARDSIZE. */ -extern int pthread_attr_setguardsize (pthread_attr_t *attr, - size_t guardsize); +extern int pthread_attr_setguardsize (pthread_attr_t *__attr, + size_t __guardsize); /* Return the value of the stacksize attribute in *ATTR in *STACKSIZE. */ -extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict attr, - size_t *__restrict stacksize); +extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, + size_t *__restrict __stacksize); /* Set the value of the stacksize attribute in *ATTR to STACKSIZE. */ -extern int pthread_attr_setstacksize (pthread_attr_t *attr, - size_t stacksize); +extern int pthread_attr_setstacksize (pthread_attr_t *__attr, + size_t __stacksize); #ifdef __USE_GNU /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread THREAD. It shall be called on an uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ -extern int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr); +extern int pthread_getattr_np (pthread_t __thread, pthread_attr_t *__attr); #endif @@ -255,54 +255,54 @@ extern pthread_t pthread_self (void); /* Initialize the mutex attribute object in *ATTR to the default values. */ -extern int pthread_mutexattr_init(pthread_mutexattr_t *attr); +extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr); /* Destroy the mutex attribute structure in *ATTR. */ -extern int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); +extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr); #ifdef __USE_UNIX98 /* Return the value of the prioceiling attribute in *ATTR in *PRIOCEILING. */ -extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict attr, - int *__restrict prioceiling); +extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __prioceiling); /* Set the value of the prioceiling attribute in *ATTR to PRIOCEILING. */ -extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, - int prioceiling); +extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr, + int __prioceiling); /* Return the value of the protocol attribute in *ATTR in *PROTOCOL. */ -extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict attr, - int *__restrict protocol); +extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __protocol); /* Set the value of the protocol attribute in *ATTR to PROTOCOL. */ -extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, - int protocol); +extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr, + int __protocol); #endif /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared attribute in *ATTR to PSHARED. */ -extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, - int pshared); +extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, + int __pshared); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return the value of the type attribute in *ATTR in *TYPE. */ -extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict attr, - int *__restrict type); +extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __type); /* Set the value of the type attribute in *ATTR to TYPE. */ -extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, - int type); +extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, + int __type); #endif @@ -323,7 +323,7 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, /* Create a mutex with attributes given by ATTR and store it in *__MUTEX. */ extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex, - const pthread_mutexattr_t *__restrict attr); + const pthread_mutexattr_t *__restrict __attr); /* Destroy the mutex __MUTEX. */ extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex); @@ -336,8 +336,8 @@ extern int pthread_mutex_trylock (pthread_mutex_t *__mutex); #ifdef __USE_XOPEN2K /* Try to lock MUTEX, block until *ABSTIME if it is already held. */ -extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict mutex, - const struct timespec *__restrict abstime); +extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex, + const struct timespec *__restrict __abstime); #endif /* Unlock MUTEX. */ @@ -345,20 +345,20 @@ extern int pthread_mutex_unlock (pthread_mutex_t *__mutex); /* Transfer ownership of the mutex MUTEX to the thread TID. The caller must own the lock. */ -extern int __pthread_mutex_transfer_np (struct __pthread_mutex *mutex, - pthread_t tid); +extern int __pthread_mutex_transfer_np (struct __pthread_mutex *__mutex, + pthread_t __tid); #ifdef __USE_UNIX98 /* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */ -extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict mutex, - int *__restrict prioceiling); +extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex, + int *__restrict __prioceiling); /* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO and return the old priority ceiling in *OLDPRIO. Before returning, release the mutex. */ -extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict mutex, - int prio, int *__restrict oldprio); +extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, + int prio, int *__restrict __oldprio); #endif @@ -369,32 +369,32 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict mutex, /* Initialize the condition attribute in *ATTR to the default values. */ -extern int pthread_condattr_init (pthread_condattr_t *attr); +extern int pthread_condattr_init (pthread_condattr_t *__attr); /* Destroy the condition attribute structure in *ATTR. */ -extern int pthread_condattr_destroy (pthread_condattr_t *attr); +extern int pthread_condattr_destroy (pthread_condattr_t *__attr); #ifdef __USE_XOPEN2K /* Return the value of the clock attribute in *ATTR in *CLOCK_ID. */ -extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict attr, - __clockid_t *__restrict clock_id); +extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict __attr, + __clockid_t *__restrict __clock_id); /* Set the value of the clock attribute in *ATTR to CLOCK_ID. */ -extern int pthread_condattr_setclock (pthread_condattr_t *attr, - __clockid_t clock_id); +extern int pthread_condattr_setclock (pthread_condattr_t *__attr, + __clockid_t __clock_id); #endif /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared attribute in *ATTR to PSHARED. */ -extern int pthread_condattr_setpshared (pthread_condattr_t *attr, - int pshared); +extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, + int __pshared); /* Condition variables. */ @@ -403,10 +403,10 @@ extern int pthread_condattr_setpshared (pthread_condattr_t *attr, #define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER -extern int pthread_cond_init (pthread_cond_t *__restrict cond, - const pthread_condattr_t *__restrict attr); +extern int pthread_cond_init (pthread_cond_t *__restrict __cond, + const pthread_condattr_t *__restrict __attr); -extern int pthread_cond_destroy (pthread_cond_t *cond); +extern int pthread_cond_destroy (pthread_cond_t *__cond); /* Unblock at least one of the threads that are blocked on condition variable COND. */ @@ -503,21 +503,21 @@ pthread_spin_unlock (pthread_spinlock_t *__lock) /* Initialize rwlock attribute object in *ATTR to the default values. */ -extern int pthread_rwlockattr_init (pthread_rwlockattr_t *attr); +extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr); /* Destroy the rwlock attribute object in *ATTR. */ -extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr); +extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr); /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared atrribute in *ATTR to PSHARED. */ -extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, - int pshared); +extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, + int __pshared); /* rwlocks. */ @@ -527,40 +527,40 @@ extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, #define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER /* Create a rwlock object with attributes given by ATTR and strore the result in *RWLOCK. */ -extern int pthread_rwlock_init (pthread_rwlock_t *__restrict rwlock, - const pthread_rwlockattr_t *__restrict attr); +extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, + const pthread_rwlockattr_t *__restrict __attr); /* Destroy the rwlock *RWLOCK. */ -extern int pthread_rwlock_destroy (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); /* Acquire the rwlock *RWLOCK for reading. */ -extern int pthread_rwlock_rdlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); /* Acquire the rwlock *RWLOCK for reading. */ -extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); # ifdef __USE_XOPEN2K /* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if it is already held. */ -extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict rwlock, - const struct timespec *__restrict abstime); +extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwlock, + const struct timespec *__restrict __abstime); # endif /* Acquire the rwlock *RWLOCK for writing. */ -extern int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); /* Try to acquire the rwlock *RWLOCK for writing. */ -extern int pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); # ifdef __USE_XOPEN2K /* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if it is already held. */ -extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict rwlock, - const struct timespec *__restrict abstime); +extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwlock, + const struct timespec *__restrict __abstime); # endif /* Release the lock held by the current thread on *RWLOCK. */ -extern int pthread_rwlock_unlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); #endif /* __USE_UNIX98 || __USE_XOPEN2K */ @@ -569,10 +569,10 @@ extern int pthread_rwlock_unlock (pthread_rwlock_t *rwlock); /* Cancelation. */ /* Register a cleanup handler. */ -extern void pthread_cleanup_push (void (*routine) (void *), void *arg); +extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg); /* Unregister a cleanup handler. */ -extern void pthread_cleanup_pop (int execute); +extern void pthread_cleanup_pop (int __execute); #include @@ -584,21 +584,21 @@ extern void pthread_cleanup_pop (int execute); /* Return the calling thread's cancelation state in *OLDSTATE and set its state to STATE. */ -extern int pthread_setcancelstate (int state, int *oldstate); +extern int pthread_setcancelstate (int __state, int *__oldstate); #define PTHREAD_CANCEL_DEFERRED 0 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 /* Return the calling thread's cancelation type in *OLDTYPE and set its type to TYPE. */ -extern int pthread_setcanceltype (int type, int *oldtype); +extern int pthread_setcanceltype (int __type, int *__oldtype); /* Value returned by pthread_join if the target thread was canceled. */ #define PTHREAD_CANCELED ((void *) -1) /* Cancel THEAD. */ -extern int pthread_cancel (pthread_t thread); +extern int pthread_cancel (pthread_t __thread); /* Add an explicit cancelation point. */ extern void pthread_testcancel (void); @@ -612,21 +612,21 @@ extern void pthread_testcancel (void); /* Initialize barrier attribute object in *ATTR to the default values. */ -extern int pthread_barrierattr_init (pthread_barrierattr_t *attr); +extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr); /* Destroy the barrier attribute object in *ATTR. */ -extern int pthread_barrierattr_destroy (pthread_barrierattr_t *attr); +extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr); /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared atrribute in *ATTR to PSHARED. */ -extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, - int pshared); +extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, + int __pshared); /* Barriers. */ @@ -638,15 +638,15 @@ extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, #define PTHREAD_BARRIER_SERIAL_THREAD -1 /* Initialize barrier BARRIER. */ -extern int pthread_barrier_init (pthread_barrier_t *__restrict barrier, - const pthread_barrierattr_t *__restrict attr, - unsigned count); +extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, + const pthread_barrierattr_t *__restrict __attr, + unsigned __count); /* Destroy barrier BARRIER. */ -extern int pthread_barrier_destroy (pthread_barrier_t *barrier); +extern int pthread_barrier_destroy (pthread_barrier_t *__barrier); /* Wait on barrier BARRIER. */ -extern int pthread_barrier_wait (pthread_barrier_t *barrier); +extern int pthread_barrier_wait (pthread_barrier_t *__barrier); #endif /* __USE_XOPEN2K */ @@ -659,18 +659,18 @@ extern int pthread_barrier_wait (pthread_barrier_t *barrier); /* Create a thread specific data key in KEY visible to all threads. On thread destruction, DESTRUCTOR shall be called with the thread specific data associate with KEY if it is not NULL. */ -extern int pthread_key_create (pthread_key_t *key, - void (*destructor) (void *)); +extern int pthread_key_create (pthread_key_t *__key, + void (*__destructor) (void *)); /* Delete the thread specific data key KEY. The associated destructor function is not called. */ -extern int pthread_key_delete (pthread_key_t key); +extern int pthread_key_delete (pthread_key_t __key); /* Return the caller thread's thread specific value of KEY. */ -extern void *pthread_getspecific (pthread_key_t key); +extern void *pthread_getspecific (pthread_key_t __key); /* Set the caller thread's thread specific value of KEY to VALUE. */ -extern int pthread_setspecific (pthread_key_t key, const void *value); +extern int pthread_setspecific (pthread_key_t __key, const void *__value); /* Dynamic package initialization. */ @@ -681,15 +681,15 @@ extern int pthread_setspecific (pthread_key_t key, const void *value); /* Call INIT_ROUTINE if this function has never been called with *ONCE_CONTROL, otherwise do nothing. */ -extern int pthread_once (pthread_once_t *once_control, - void (*init_routine) (void)); +extern int pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)); /* Concurrency. */ #ifdef __USE_UNIX98 /* Set the desired concurrency level to NEW_LEVEL. */ -extern int pthread_setconcurrency (int new_level); +extern int pthread_setconcurrency (int __new_level); /* Get the current concurrency level. */ extern int pthread_getconcurrency (void); @@ -705,36 +705,36 @@ extern int pthread_getconcurrency (void); NULL. The prepare handles will be called in the reverse order which they were registered and the parent and child handlers in the order in which they were registered. */ -extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), - void (*child) (void)); +extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), + void (*__child) (void)); /* Signals (should be in ). */ /* Send signal SIGNO to thread THREAD. */ -extern int pthread_kill (pthread_t thread, int signo); +extern int pthread_kill (pthread_t __thread, int __signo); /* Time. */ #ifdef __USE_XOPEN2K /* Return the thread cpu clock. */ -extern int pthread_getcpuclockid (pthread_t thread, __clockid_t *clock); +extern int pthread_getcpuclockid (pthread_t __thread, __clockid_t *__clock); #endif /* Scheduling. */ /* Return thread THREAD's scheduling paramters. */ -extern int pthread_getschedparam (pthread_t thread, int *__restrict policy, - struct sched_param *__restrict param); +extern int pthread_getschedparam (pthread_t __thread, int *__restrict __policy, + struct sched_param *__restrict __param); /* Set thread THREAD's scheduling paramters. */ -extern int pthread_setschedparam (pthread_t thread, int policy, - const struct sched_param *param); +extern int pthread_setschedparam (pthread_t __thread, int __policy, + const struct sched_param *__param); /* Set thread THREAD's scheduling priority. */ -extern int pthread_setschedprio (pthread_t thread, int prio); +extern int pthread_setschedprio (pthread_t __thread, int __prio); #ifdef __USE_GNU /* Yield the processor to another thread or process. diff --git a/sysdeps/mach/hurd/bits/pthread-np.h b/sysdeps/mach/hurd/bits/pthread-np.h index 5f75e06..4487ffd 100644 --- a/sysdeps/mach/hurd/bits/pthread-np.h +++ b/sysdeps/mach/hurd/bits/pthread-np.h @@ -33,6 +33,6 @@ extern int pthread_hurd_cond_wait_np (pthread_cond_t *__restrict __cond, See hurd_thread_cancel. */ extern int pthread_hurd_cond_timedwait_np (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, - const struct timespec *abstime); + const struct timespec *__abstime); #endif /* bits/pthread-np.h */ -- cgit v1.2.3 From 8dbe53c35395c82514475a94a3c7353a9aaf2651 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 22 Sep 2015 03:08:26 +0200 Subject: Fix name exposure of including semaphore.h * sysdeps/pthread/bits/semaphore.h: Include and instead of the full . --- sysdeps/pthread/bits/semaphore.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps') diff --git a/sysdeps/pthread/bits/semaphore.h b/sysdeps/pthread/bits/semaphore.h index 5e987c1..4c78409 100644 --- a/sysdeps/pthread/bits/semaphore.h +++ b/sysdeps/pthread/bits/semaphore.h @@ -24,7 +24,8 @@ #error Never include directly. #endif -#include +#include +#include /* User visible part of a semaphore. */ struct __semaphore -- cgit v1.2.3 From dc28c9c42afb66c751c894ab923917e9bda93adc Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 10 Oct 2015 12:56:27 +0200 Subject: Fix errno set by raise * sysdeps/generic/raise.c: Include and . (raise): Only set errno when calling pthread_kill, not kill. --- sysdeps/generic/raise.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index 15348ce..3c497da 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -19,6 +19,8 @@ . */ #include +#include +#include #pragma weak pthread_kill #pragma weak pthread_self @@ -29,17 +31,18 @@ raise (int signo) "the effect of the raise() function shall be equivalent to calling: pthread_kill(pthread_self(), sig);" */ - int err; if (pthread_kill) - err = pthread_kill (pthread_self (), signo); - else - err = __kill (__getpid (), signo); - if (err) { - errno = err; - return -1; + int err; + err = pthread_kill (pthread_self (), signo); + if (err) + { + errno = err; + return -1; + } + return 0; } - - return 0; + else + return __kill (__getpid (), signo); } -- cgit v1.2.3 From 08d8159d5a960466bb9a951ecc8036baa4d74e6b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 10 Oct 2015 16:42:29 +0200 Subject: Fix pthread_kill * sysdeps/hurd/pt-kill.c (pthread_kill): Lock ss lock before calling _hurd_raise_signal. Return error returned by _hurd_raise_signal. --- sysdeps/hurd/pt-kill.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/hurd/pt-kill.c b/sysdeps/hurd/pt-kill.c index d204e3f..49dfd7d 100644 --- a/sysdeps/hurd/pt-kill.c +++ b/sysdeps/hurd/pt-kill.c @@ -46,7 +46,6 @@ pthread_kill (pthread_t thread, int sig) detail.code = sig; detail.error = 0; - _hurd_raise_signal (ss, sig, &detail); - - return 0; + __spin_lock (&ss->lock); + return _hurd_raise_signal (ss, sig, &detail); } -- cgit v1.2.3