diff mbox series

Consolidate Linux sigpending() implementation

Message ID 20171013182721.24430-1-ynorov@caviumnetworks.com
State New
Headers show
Series Consolidate Linux sigpending() implementation | expand

Commit Message

Yury Norov Oct. 13, 2017, 6:27 p.m. UTC
ia64, s390-64, sparc64 and x86_64 host their own implementation of
sigpending() in corresponding files, but they are identical to generic
linux file despite few comments. This patch removes that files, so the
implementation of sigpending() is taken from sysdeps/unix/sysv/linux
for all ports.

Build-tested on x86_64.

	* sysdeps/unix/sysv/linux/ia64/sigpending.c: Remove file;
	* sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c: Likewise; 
	* sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Likewise;
	* sysdeps/unix/sysv/linux/x86_64/sigpending.c: Likewise.

---
 sysdeps/unix/sysv/linux/ia64/sigpending.c          | 36 ----------------------
 sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c  | 36 ----------------------
 sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c | 33 --------------------
 sysdeps/unix/sysv/linux/x86_64/sigpending.c        | 36 ----------------------
 4 files changed, 141 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/ia64/sigpending.c
 delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
 delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/sigpending.c

Comments

Adhemerval Zanella Oct. 13, 2017, 7:18 p.m. UTC | #1
On 13/10/2017 15:27, Yury Norov wrote:
> ia64, s390-64, sparc64 and x86_64 host their own implementation of
> sigpending() in corresponding files, but they are identical to generic
> linux file despite few comments. This patch removes that files, so the
> implementation of sigpending() is taken from sysdeps/unix/sysv/linux
> for all ports.
> 
> Build-tested on x86_64.
> 
> 	* sysdeps/unix/sysv/linux/ia64/sigpending.c: Remove file;
> 	* sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c: Likewise; 
> 	* sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Likewise;
> 	* sysdeps/unix/sysv/linux/x86_64/sigpending.c: Likewise.

LGTM.

> 
> ---
>  sysdeps/unix/sysv/linux/ia64/sigpending.c          | 36 ----------------------
>  sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c  | 36 ----------------------
>  sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c | 33 --------------------
>  sysdeps/unix/sysv/linux/x86_64/sigpending.c        | 36 ----------------------
>  4 files changed, 141 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/ia64/sigpending.c
>  delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
>  delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
>  delete mode 100644 sysdeps/unix/sysv/linux/x86_64/sigpending.c
> 
> diff --git a/sysdeps/unix/sysv/linux/ia64/sigpending.c b/sysdeps/unix/sysv/linux/ia64/sigpending.c
> deleted file mode 100644
> index b1653231de..0000000000
> --- a/sysdeps/unix/sysv/linux/ia64/sigpending.c
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -/* Copyright (C) 1997-2017 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
> -   <http://www.gnu.org/licenses/>.  */
> -
> -/* Linux/ia64 only has rt signals, thus we do not even want to try falling
> -   back to the old style signals as the default Linux handler does. */
> -
> -#include <errno.h>
> -#include <signal.h>
> -#include <unistd.h>
> -
> -#include <sysdep.h>
> -#include <sys/syscall.h>
> -
> -/* Change the set of blocked signals to SET,
> -   wait until a signal arrives, and restore the set of blocked signals.  */
> -int
> -sigpending (sigset_t *set)
> -{
> -  /* XXX The size argument hopefully will have to be changed to the
> -     real size of the user-level sigset_t.  */
> -  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
> -}
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
> deleted file mode 100644
> index daf8cfd1b8..0000000000
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -/* Copyright (C) 2001-2017 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
> -   <http://www.gnu.org/licenses/>.  */
> -
> -/* 64 bit Linux for S/390 only has rt signals, thus we do not even want to try
> -   falling back to the old style signals as the default Linux handler does. */
> -
> -#include <errno.h>
> -#include <signal.h>
> -#include <unistd.h>
> -
> -#include <sysdep.h>
> -#include <sys/syscall.h>
> -
> -/* Change the set of blocked signals to SET,
> -   wait until a signal arrives, and restore the set of blocked signals.  */
> -int
> -sigpending (sigset_t *set)
> -{
> -  /* XXX The size argument hopefully will have to be changed to the
> -     real size of the user-level sigset_t.  */
> -  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
> -}
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
> deleted file mode 100644
> index 7e82927435..0000000000
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/* Copyright (C) 1997-2017 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
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <signal.h>
> -#include <unistd.h>
> -
> -#include <sysdep.h>
> -#include <sys/syscall.h>
> -
> -/* Change the set of blocked signals to SET,
> -   wait until a signal arrives, and restore the set of blocked signals.  */
> -int
> -sigpending (sigset_t *set)
> -{
> -  /* XXX The size argument hopefully will have to be changed to the
> -     real size of the user-level sigset_t.  */
> -  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
> -}
> diff --git a/sysdeps/unix/sysv/linux/x86_64/sigpending.c b/sysdeps/unix/sysv/linux/x86_64/sigpending.c
> deleted file mode 100644
> index 410217ed84..0000000000
> --- a/sysdeps/unix/sysv/linux/x86_64/sigpending.c
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -/* Copyright (C) 1997-2017 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
> -   <http://www.gnu.org/licenses/>.  */
> -
> -/* Linux/x86_64 only has rt signals, thus we do not even want to try falling
> -   back to the old style signals as the default Linux handler does. */
> -
> -#include <errno.h>
> -#include <signal.h>
> -#include <unistd.h>
> -
> -#include <sysdep.h>
> -#include <sys/syscall.h>
> -
> -/* Change the set of blocked signals to SET,
> -   wait until a signal arrives, and restore the set of blocked signals.  */
> -int
> -sigpending (sigset_t *set)
> -{
> -  /* XXX The size argument hopefully will have to be changed to the
> -     real size of the user-level sigset_t.  */
> -  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
> -}
>
Yury Norov Oct. 17, 2017, 9:48 p.m. UTC | #2
Hi Adhemerval,

On Fri, Oct 13, 2017 at 04:18:08PM -0300, Adhemerval Zanella wrote:
> 
> On 13/10/2017 15:27, Yury Norov wrote:
> > ia64, s390-64, sparc64 and x86_64 host their own implementation of
> > sigpending() in corresponding files, but they are identical to generic
> > linux file despite few comments. This patch removes that files, so the
> > implementation of sigpending() is taken from sysdeps/unix/sysv/linux
> > for all ports.
> > 
> > Build-tested on x86_64.
> > 
> > 	* sysdeps/unix/sysv/linux/ia64/sigpending.c: Remove file;
> > 	* sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c: Likewise; 
> > 	* sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Likewise;
> > 	* sysdeps/unix/sysv/linux/x86_64/sigpending.c: Likewise.
> 
> LGTM.

Thanks for review. It seems, there's no objections to the patch, but I
can't push it upstream. Could you please do it for me?

Yury
Adhemerval Zanella Oct. 31, 2017, 7:53 p.m. UTC | #3
On 17/10/2017 19:48, Yury Norov wrote:
> Hi Adhemerval,
> 
> On Fri, Oct 13, 2017 at 04:18:08PM -0300, Adhemerval Zanella wrote:
>>
>> On 13/10/2017 15:27, Yury Norov wrote:
>>> ia64, s390-64, sparc64 and x86_64 host their own implementation of
>>> sigpending() in corresponding files, but they are identical to generic
>>> linux file despite few comments. This patch removes that files, so the
>>> implementation of sigpending() is taken from sysdeps/unix/sysv/linux
>>> for all ports.
>>>
>>> Build-tested on x86_64.
>>>
>>> 	* sysdeps/unix/sysv/linux/ia64/sigpending.c: Remove file;
>>> 	* sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c: Likewise; 
>>> 	* sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Likewise;
>>> 	* sysdeps/unix/sysv/linux/x86_64/sigpending.c: Likewise.
>>
>> LGTM.
> 
> Thanks for review. It seems, there's no objections to the patch, but I
> can't push it upstream. Could you please do it for me?
> 
> Yury
> 

Sorry for take that long, pushed upstream as e8681fa (I just fixed the
ChangeLog punctuation).
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/ia64/sigpending.c b/sysdeps/unix/sysv/linux/ia64/sigpending.c
deleted file mode 100644
index b1653231de..0000000000
--- a/sysdeps/unix/sysv/linux/ia64/sigpending.c
+++ /dev/null
@@ -1,36 +0,0 @@ 
-/* Copyright (C) 1997-2017 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
-   <http://www.gnu.org/licenses/>.  */
-
-/* Linux/ia64 only has rt signals, thus we do not even want to try falling
-   back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
-   wait until a signal arrives, and restore the set of blocked signals.  */
-int
-sigpending (sigset_t *set)
-{
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c b/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
deleted file mode 100644
index daf8cfd1b8..0000000000
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c
+++ /dev/null
@@ -1,36 +0,0 @@ 
-/* Copyright (C) 2001-2017 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
-   <http://www.gnu.org/licenses/>.  */
-
-/* 64 bit Linux for S/390 only has rt signals, thus we do not even want to try
-   falling back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
-   wait until a signal arrives, and restore the set of blocked signals.  */
-int
-sigpending (sigset_t *set)
-{
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c b/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
deleted file mode 100644
index 7e82927435..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* Copyright (C) 1997-2017 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
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
-   wait until a signal arrives, and restore the set of blocked signals.  */
-int
-sigpending (sigset_t *set)
-{
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigpending.c b/sysdeps/unix/sysv/linux/x86_64/sigpending.c
deleted file mode 100644
index 410217ed84..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/sigpending.c
+++ /dev/null
@@ -1,36 +0,0 @@ 
-/* Copyright (C) 1997-2017 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
-   <http://www.gnu.org/licenses/>.  */
-
-/* Linux/x86_64 only has rt signals, thus we do not even want to try falling
-   back to the old style signals as the default Linux handler does. */
-
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* Change the set of blocked signals to SET,
-   wait until a signal arrives, and restore the set of blocked signals.  */
-int
-sigpending (sigset_t *set)
-{
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
-}