summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-15 19:33:47 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:37 +0200
commit7049cfee24a745b918a6a55fe0e076c1ab75f563 (patch)
treeb64be16c553319312793ec885cc23d79fe83a3b1
parent95a2ed35514f8e5cc1d1de423a589dedc54df092 (diff)
signal: cleanup, include only headers that are needed
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r--include/signal.h2
-rw-r--r--libc/signal/allocrtsig.c1
-rw-r--r--libc/signal/killpg.c1
-rw-r--r--libc/signal/raise.c2
-rw-r--r--libc/signal/sigaction.c8
-rw-r--r--libc/signal/sigaddset.c5
-rw-r--r--libc/signal/sigblock.c1
-rw-r--r--libc/signal/sigdelset.c5
-rw-r--r--libc/signal/sigempty.c7
-rw-r--r--libc/signal/sigfillset.c9
-rw-r--r--libc/signal/siggetmask.c1
-rw-r--r--libc/signal/sighold.c1
-rw-r--r--libc/signal/sigignore.c4
-rw-r--r--libc/signal/sigintr.c8
-rw-r--r--libc/signal/sigismem.c5
-rw-r--r--libc/signal/sigjmp.c2
-rw-r--r--libc/signal/signal.c2
-rw-r--r--libc/signal/sigpause.c3
-rw-r--r--libc/signal/sigrelse.c1
-rw-r--r--libc/signal/sigset.c3
-rw-r--r--libc/signal/sigsetmask.c1
-rw-r--r--libc/signal/sigsetops.h33
-rw-r--r--libc/signal/sigwait.c8
-rw-r--r--libc/signal/sysv_signal.c2
24 files changed, 41 insertions, 74 deletions
diff --git a/include/signal.h b/include/signal.h
index d8bb5d277..9a2608271 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -259,7 +259,6 @@ extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1));
/* Set all signals in SET. */
extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1));
-libc_hidden_proto(sigfillset)
/* Add SIGNO to SET. */
extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
@@ -484,6 +483,7 @@ extern int __libc_current_sigrtmin (void) __THROW;
extern int __libc_current_sigrtmax (void) __THROW;
#ifdef _LIBC
+extern sigset_t _sigintr attribute_hidden;
/* simplified version without parameter checking */
# include <string.h>
# undef __sigemptyset
diff --git a/libc/signal/allocrtsig.c b/libc/signal/allocrtsig.c
index 05f3d6c90..2b2098f56 100644
--- a/libc/signal/allocrtsig.c
+++ b/libc/signal/allocrtsig.c
@@ -20,7 +20,6 @@
#include <features.h>
#include <signal.h>
-#include <sys/types.h>
#include <sys/syscall.h>
/* Only enable rt signals when it is supported at compile time */
diff --git a/libc/signal/killpg.c b/libc/signal/killpg.c
index c2dc713d9..73f48ec3a 100644
--- a/libc/signal/killpg.c
+++ b/libc/signal/killpg.c
@@ -19,7 +19,6 @@
#include <errno.h>
#include <signal.h>
-
/* Send SIG to all processes in process group PGRP.
If PGRP is zero, send SIG to all processes in
the current process's process group. */
diff --git a/libc/signal/raise.c b/libc/signal/raise.c
index aed9b46d7..d9dbab672 100644
--- a/libc/signal/raise.c
+++ b/libc/signal/raise.c
@@ -3,9 +3,7 @@
*/
#include <unistd.h>
-#include <string.h>
#include <signal.h>
-#include <sys/types.h>
int raise(int signo)
{
diff --git a/libc/signal/sigaction.c b/libc/signal/sigaction.c
index 5a5a60c3a..d6aef331b 100644
--- a/libc/signal/sigaction.c
+++ b/libc/signal/sigaction.c
@@ -16,14 +16,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <features.h>
-#include <errno.h>
#include <signal.h>
-#include <string.h>
#include <sys/syscall.h>
-#include <bits/kernel_sigaction.h>
-
#if defined __NR_rt_sigaction
/* If ACT is not NULL, change the action for SIG to *ACT.
@@ -42,6 +37,9 @@ __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
}
#else
+# define __need_NULL
+# include <stddef.h>
+# include <bits/kernel_sigaction.h>
/* If ACT is not NULL, change the action for SIG to *ACT.
If OACT is not NULL, put the old action for SIG in *OACT. */
diff --git a/libc/signal/sigaddset.c b/libc/signal/sigaddset.c
index 7577d37c2..94fcc80e2 100644
--- a/libc/signal/sigaddset.c
+++ b/libc/signal/sigaddset.c
@@ -16,7 +16,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include "sigsetops.h"
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+#include <errno.h>
/* Add SIGNO to SET. */
int
diff --git a/libc/signal/sigblock.c b/libc/signal/sigblock.c
index ad3acb0be..c3ce36307 100644
--- a/libc/signal/sigblock.c
+++ b/libc/signal/sigblock.c
@@ -17,7 +17,6 @@
02111-1307 USA. */
#define __UCLIBC_HIDE_DEPRECATED__
-#include <errno.h>
#include <signal.h>
#include "sigset-cvt-mask.h"
diff --git a/libc/signal/sigdelset.c b/libc/signal/sigdelset.c
index ff30303ea..9262b1a65 100644
--- a/libc/signal/sigdelset.c
+++ b/libc/signal/sigdelset.c
@@ -16,7 +16,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include "sigsetops.h"
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+#include <errno.h>
/* Add SIGNO to SET. */
int sigdelset (sigset_t *set, int signo)
diff --git a/libc/signal/sigempty.c b/libc/signal/sigempty.c
index 2622c0872..adbded62a 100644
--- a/libc/signal/sigempty.c
+++ b/libc/signal/sigempty.c
@@ -16,9 +16,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <errno.h>
#include <signal.h>
-#include <string.h>
+#if 0
+#define __need_NULL
+#include <stddef.h>
+#include <errno.h>
+#endif
/* Clear all signals from SET. */
int sigemptyset (sigset_t *set)
diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c
index 951e76b79..ef60f1005 100644
--- a/libc/signal/sigfillset.c
+++ b/libc/signal/sigfillset.c
@@ -16,10 +16,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <errno.h>
#include <signal.h>
-#include <string.h>
-
+#if 0
+#define __need_NULL
+#include <stddef.h>
+#include <errno.h>
+#endif
/* Set all signals in SET. */
int
@@ -46,4 +48,3 @@ sigfillset (sigset_t *set)
return 0;
}
-libc_hidden_def(sigfillset)
diff --git a/libc/signal/siggetmask.c b/libc/signal/siggetmask.c
index 3992a7a0a..833de969e 100644
--- a/libc/signal/siggetmask.c
+++ b/libc/signal/siggetmask.c
@@ -20,7 +20,6 @@
#define __UCLIBC_HIDE_DEPRECATED__
#include <signal.h>
-
int
siggetmask (void)
{
diff --git a/libc/signal/sighold.c b/libc/signal/sighold.c
index 6a2e718cd..2b1ecd14f 100644
--- a/libc/signal/sighold.c
+++ b/libc/signal/sighold.c
@@ -22,7 +22,6 @@
#include <stddef.h>
#include <signal.h>
-
int sighold (int sig)
{
sigset_t set;
diff --git a/libc/signal/sigignore.c b/libc/signal/sigignore.c
index a74c10522..984fd854b 100644
--- a/libc/signal/sigignore.c
+++ b/libc/signal/sigignore.c
@@ -18,12 +18,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <errno.h>
#define __need_NULL
#include <stddef.h>
#include <signal.h>
-#include <string.h> /* For the real memset prototype. */
-
+#include <string.h>
int sigignore (int sig)
{
diff --git a/libc/signal/sigintr.c b/libc/signal/sigintr.c
index 10567e939..210d493ca 100644
--- a/libc/signal/sigintr.c
+++ b/libc/signal/sigintr.c
@@ -16,16 +16,16 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <stddef.h>
#include <signal.h>
-#include <errno.h>
-
/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
(causing them to fail with EINTR); if INTERRUPT is zero, make system
calls be restarted after signal SIG. */
#ifdef SA_RESTART
-extern sigset_t _sigintr attribute_hidden; /* Defined in signal.c. */
+# define __need_NULL
+# include <stddef.h>
+#else
+# include <errno.h>
#endif
int siginterrupt (int sig, int interrupt)
diff --git a/libc/signal/sigismem.c b/libc/signal/sigismem.c
index b546f626f..334a06f82 100644
--- a/libc/signal/sigismem.c
+++ b/libc/signal/sigismem.c
@@ -16,7 +16,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include "sigsetops.h"
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+#include <errno.h>
/* Return 1 if SIGNO is in SET, 0 if not. */
int sigismember (const sigset_t *set, int signo)
diff --git a/libc/signal/sigjmp.c b/libc/signal/sigjmp.c
index a96d6623b..cf2be682e 100644
--- a/libc/signal/sigjmp.c
+++ b/libc/signal/sigjmp.c
@@ -16,11 +16,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define __need_NULL
#include <stddef.h>
#include <setjmp.h>
#include <signal.h>
-
/* This function is called by the `sigsetjmp' macro
before doing a `__setjmp' on ENV[0].__jmpbuf.
Always return zero. */
diff --git a/libc/signal/signal.c b/libc/signal/signal.c
index 644617c15..d82e421ec 100644
--- a/libc/signal/signal.c
+++ b/libc/signal/signal.c
@@ -22,7 +22,7 @@
#include <signal.h>
#include <string.h> /* For the real memset prototype. */
-sigset_t _sigintr attribute_hidden; /* Set by siginterrupt. */
+sigset_t _sigintr; /* Set by siginterrupt. */
/* Set the handler for the signal SIG to HANDLER,
returning the old handler, or SIG_ERR on error. */
diff --git a/libc/signal/sigpause.c b/libc/signal/sigpause.c
index 0856ba2e6..e773b3c13 100644
--- a/libc/signal/sigpause.c
+++ b/libc/signal/sigpause.c
@@ -22,7 +22,8 @@
#include <errno.h>
#define __FAVOR_BSD
#include <signal.h>
-#include <stddef.h> /* For NULL. */
+#define __need_NULL
+#include <stddef.h>
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
#include <sysdep-cancel.h>
#endif
diff --git a/libc/signal/sigrelse.c b/libc/signal/sigrelse.c
index 07e7fddf3..b5136482e 100644
--- a/libc/signal/sigrelse.c
+++ b/libc/signal/sigrelse.c
@@ -22,7 +22,6 @@
#include <stddef.h>
#include <signal.h>
-
int sigrelse (int sig)
{
sigset_t set;
diff --git a/libc/signal/sigset.c b/libc/signal/sigset.c
index b91ce8083..3b162df31 100644
--- a/libc/signal/sigset.c
+++ b/libc/signal/sigset.c
@@ -20,8 +20,7 @@
#define __need_NULL
#include <stddef.h>
#include <signal.h>
-#include <string.h> /* For the real memset prototype. */
-
+#include <string.h>
/* Set the disposition for SIG. */
__sighandler_t sigset (int sig, __sighandler_t disp)
diff --git a/libc/signal/sigsetmask.c b/libc/signal/sigsetmask.c
index 64c8ad687..0a731795d 100644
--- a/libc/signal/sigsetmask.c
+++ b/libc/signal/sigsetmask.c
@@ -17,7 +17,6 @@
02111-1307 USA. */
#define __UCLIBC_HIDE_DEPRECATED__
-#include <errno.h>
#include <signal.h>
#include "sigset-cvt-mask.h"
diff --git a/libc/signal/sigsetops.h b/libc/signal/sigsetops.h
deleted file mode 100644
index 52081c2ba..000000000
--- a/libc/signal/sigsetops.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 1991, 1995, 1996 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Definitions relevant to functions that operate on `sigset_t's. */
-
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
-
-#define BITS (_NSIG - 1)
-#define ELT(signo) (((signo) - 1) / BITS)
-#define MASK(signo) (1 << (((signo) - 1) % BITS))
-
-#undef sigemptyset
-#undef sigfillset
-#undef sigaddset
-#undef sigdelset
-#undef sigismember
diff --git a/libc/signal/sigwait.c b/libc/signal/sigwait.c
index 634a18dc5..5e9c4275f 100644
--- a/libc/signal/sigwait.c
+++ b/libc/signal/sigwait.c
@@ -19,15 +19,15 @@
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA. */
-#include <errno.h>
+#define __need_NULL
+#include <stddef.h>
#include <signal.h>
-#include <string.h>
-#include <unistd.h>
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
# include <sysdep-cancel.h>
# ifdef __NR_rt_sigtimedwait
+# include <string.h>
/* Return any pending signal or wait for one for the given time. */
static int do_sigwait(const sigset_t *set, int *sig)
@@ -104,6 +104,8 @@ int sigwait (const sigset_t *set, int *sig)
}
# else /* __UCLIBC_HAS_REALTIME__ */
+# include <errno.h>
+# include <unistd.h> /* smallint */
/* variant without REALTIME extensions */
static smallint was_sig; /* obviously not thread-safe */
diff --git a/libc/signal/sysv_signal.c b/libc/signal/sysv_signal.c
index a696a5426..65d8190d0 100644
--- a/libc/signal/sysv_signal.c
+++ b/libc/signal/sysv_signal.c
@@ -18,8 +18,6 @@
#include <errno.h>
#include <signal.h>
-#include <string.h> /* For the real memset prototype. */
-
/* Tolerate non-threads versions of Posix */
#ifndef SA_ONESHOT