diff options
-rw-r--r-- | libc/signal/Makefile.in | 22 | ||||
-rw-r--r-- | libc/signal/allocrtsig.c | 1 | ||||
-rw-r--r-- | libc/signal/killpg.c | 3 | ||||
-rw-r--r-- | libc/signal/raise.c | 18 | ||||
-rw-r--r-- | libc/signal/sigaction.c | 15 | ||||
-rw-r--r-- | libc/signal/sigaddset.c | 2 | ||||
-rw-r--r-- | libc/signal/sigandset.c | 1 | ||||
-rw-r--r-- | libc/signal/sigblock.c | 11 | ||||
-rw-r--r-- | libc/signal/sigdelset.c | 6 | ||||
-rw-r--r-- | libc/signal/sigempty.c | 6 | ||||
-rw-r--r-- | libc/signal/sigfillset.c | 13 | ||||
-rw-r--r-- | libc/signal/siggetmask.c | 6 | ||||
-rw-r--r-- | libc/signal/sighold.c | 8 | ||||
-rw-r--r-- | libc/signal/sigignore.c | 4 | ||||
-rw-r--r-- | libc/signal/sigintr.c | 9 | ||||
-rw-r--r-- | libc/signal/sigisempty.c | 1 | ||||
-rw-r--r-- | libc/signal/sigjmp.c | 6 | ||||
-rw-r--r-- | libc/signal/signal.c | 13 | ||||
-rw-r--r-- | libc/signal/sigorset.c | 1 | ||||
-rw-r--r-- | libc/signal/sigpause.c | 21 | ||||
-rw-r--r-- | libc/signal/sigrelse.c | 10 | ||||
-rw-r--r-- | libc/signal/sigset.c | 9 | ||||
-rw-r--r-- | libc/signal/sigsetmask.c | 12 | ||||
-rw-r--r-- | libc/signal/sigsetops.c | 2 | ||||
-rw-r--r-- | libc/signal/sigwait.c | 86 | ||||
-rw-r--r-- | libc/signal/sysv_signal.c | 6 |
26 files changed, 123 insertions, 169 deletions
diff --git a/libc/signal/Makefile.in b/libc/signal/Makefile.in index f21e5ebaa..8b09ad950 100644 --- a/libc/signal/Makefile.in +++ b/libc/signal/Makefile.in @@ -1,11 +1,11 @@ # Makefile for uClibc # -# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> # # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CSRC:= allocrtsig.c killpg.c raise.c sigaction.c sigaddset.c sigandset.c \ +CSRC := allocrtsig.c killpg.c raise.c sigaction.c sigaddset.c sigandset.c \ sigblock.c sigdelset.c sigempty.c sigfillset.c siggetmask.c sighold.c \ sigignore.c sigintr.c sigisempty.c sigismem.c sigjmp.c signal.c \ sigorset.c sigpause.c sigrelse.c sigset.c sigsetmask.c sigsetops.c \ @@ -16,22 +16,18 @@ CSRC:=$(filter-out raise.c,$(CSRC)) endif ifneq ($(strip $(ARCH_OBJS)),) -CSRC:=$(filter-out $(notdir $(ARCH_OBJS:.o=.c)),$(CSRC)) +CSRC := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)),$(CSRC)) endif -SIGNAL_DIR:=$(top_srcdir)libc/signal -SIGNAL_OUT:=$(top_builddir)libc/signal +SIGNAL_DIR := $(top_srcdir)libc/signal +SIGNAL_OUT := $(top_builddir)libc/signal -SIGNAL_SRC:=$(patsubst %.c,$(SIGNAL_DIR)/%.c,$(CSRC)) +SIGNAL_SRC := $(patsubst %.c,$(SIGNAL_DIR)/%.c,$(CSRC)) +SIGNAL_OBJ := $(patsubst %.c,$(SIGNAL_OUT)/%.o,$(CSRC)) -SIGNAL_OBJ:=$(patsubst $(SIGNAL_DIR)/%.c,$(SIGNAL_OUT)/%.o,$(SIGNAL_SRC)) +libc-y += $(SIGNAL_OBJ) -libc-a-y+=$(SIGNAL_OBJ) -libc-so-y+=$(SIGNAL_OBJ:.o=.os) - -libc-multi-y+=$(SIGNAL_SRC) - -objclean-y+=signal_objclean +objclean-y += signal_objclean signal_objclean: $(RM) $(SIGNAL_OUT)/*.{o,os} diff --git a/libc/signal/allocrtsig.c b/libc/signal/allocrtsig.c index 0bdbd2842..87fd9a641 100644 --- a/libc/signal/allocrtsig.c +++ b/libc/signal/allocrtsig.c @@ -55,6 +55,7 @@ int __libc_current_sigrtmax (void) /* Allocate real-time signal with highest/lowest available priority. Please note that we don't use a lock since we assume this function to be called at program start. */ +int __libc_allocate_rtsig (int high); int __libc_allocate_rtsig (int high) { if (current_rtmin == -1 || current_rtmin > current_rtmax) diff --git a/libc/signal/killpg.c b/libc/signal/killpg.c index 91a332af6..6de79a714 100644 --- a/libc/signal/killpg.c +++ b/libc/signal/killpg.c @@ -16,11 +16,10 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define kill __kill - #include <errno.h> #include <signal.h> +libc_hidden_proto(kill) /* Send SIG to all processes in process group PGRP. If PGRP is zero, send SIG to all processes in diff --git a/libc/signal/raise.c b/libc/signal/raise.c index 5a964c4b6..9761ac162 100644 --- a/libc/signal/raise.c +++ b/libc/signal/raise.c @@ -3,18 +3,20 @@ * under the GNU Library General Public License. */ -#define kill __kill - #include <unistd.h> #include <string.h> #include <signal.h> #include <sys/types.h> -#undef raise -int attribute_hidden __raise(int signo) + +libc_hidden_proto(getpid) +libc_hidden_proto(kill) + +int __raise (int signo) attribute_hidden; +int __raise(int signo) { - return kill(__getpid(), signo); + return kill(getpid(), signo); } - -/* psm: keep this weak, because the one in libpthread.so could overwrite it */ -weak_alias(__raise, raise) +libc_hidden_proto(raise) +weak_alias(__raise,raise) +libc_hidden_def(raise) diff --git a/libc/signal/sigaction.c b/libc/signal/sigaction.c index 5336b7609..14e3dc9c2 100644 --- a/libc/signal/sigaction.c +++ b/libc/signal/sigaction.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc. +/* Copyright (C) 1997-2000,2002,2003,2005,2006 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 @@ -16,18 +16,24 @@ 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> +libc_hidden_proto(memcpy) /* The difference here is that the sigaction structure used in the kernel is not the same as we use in the libc. Therefore we must translate it here. */ #include <bits/kernel_sigaction.h> +#ifndef LIBC_SIGACTION +extern __typeof(sigaction) __libc_sigaction; +#endif + #if defined __NR_rt_sigaction /* If ACT is not NULL, change the action for SIG to *ACT. @@ -40,7 +46,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) if (act) { kact.k_sa_handler = act->sa_handler; - __memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask)); + memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); kact.sa_flags = act->sa_flags; # ifdef HAVE_SA_RESTORER kact.sa_restorer = act->sa_restorer; @@ -55,7 +61,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) if (oact && result >= 0) { oact->sa_handler = koact.k_sa_handler; - __memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask)); + memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); oact->sa_flags = koact.sa_flags; # ifdef HAVE_SA_RESTORER oact->sa_restorer = koact.sa_restorer; @@ -103,6 +109,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) #endif #ifndef LIBC_SIGACTION -hidden_weak_alias(__libc_sigaction,__sigaction) +libc_hidden_proto(sigaction) weak_alias(__libc_sigaction,sigaction) +libc_hidden_weak(sigaction) #endif diff --git a/libc/signal/sigaddset.c b/libc/signal/sigaddset.c index e5813c117..83721772c 100644 --- a/libc/signal/sigaddset.c +++ b/libc/signal/sigaddset.c @@ -19,6 +19,7 @@ #include "sigsetops.h" /* Add SIGNO to SET. */ +libc_hidden_proto(sigaddset) int sigaddset (set, signo) sigset_t *set; @@ -32,3 +33,4 @@ sigaddset (set, signo) return __sigaddset (set, signo); } +libc_hidden_def(sigaddset) diff --git a/libc/signal/sigandset.c b/libc/signal/sigandset.c index 4e1abd969..a25225bad 100644 --- a/libc/signal/sigandset.c +++ b/libc/signal/sigandset.c @@ -17,7 +17,6 @@ 02111-1307 USA. */ #include <errno.h> -#define __USE_GNU #include <signal.h> #define __need_NULL #include <stddef.h> diff --git a/libc/signal/sigblock.c b/libc/signal/sigblock.c index d3568b9f5..1f1a9fe98 100644 --- a/libc/signal/sigblock.c +++ b/libc/signal/sigblock.c @@ -16,23 +16,26 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define __UCLIBC_HIDE_DEPRECATED__ #include <errno.h> #include <signal.h> +libc_hidden_proto(sigprocmask) + #include "sigset-cvt-mask.h" /* Block signals in MASK, returning the old mask. */ -int attribute_hidden __sigblock (int mask) +libc_hidden_proto(sigblock) +int sigblock (int mask) { sigset_t set, oset; if (sigset_set_old_mask (&set, mask) < 0) return -1; - if (__sigprocmask (SIG_BLOCK, &set, &oset) < 0) + if (sigprocmask (SIG_BLOCK, &set, &oset) < 0) return -1; return sigset_get_old_mask (&oset); } - -strong_alias (__sigblock, sigblock) +libc_hidden_def(sigblock) diff --git a/libc/signal/sigdelset.c b/libc/signal/sigdelset.c index ea36b6c3c..de988a7e8 100644 --- a/libc/signal/sigdelset.c +++ b/libc/signal/sigdelset.c @@ -19,8 +19,8 @@ #include "sigsetops.h" /* Add SIGNO to SET. */ -int attribute_hidden -__sigdelset_internal (sigset_t *set, int signo) +libc_hidden_proto(sigdelset) +int sigdelset (sigset_t *set, int signo) { if (set == NULL || signo <= 0 || signo >= NSIG) { @@ -30,4 +30,4 @@ __sigdelset_internal (sigset_t *set, int signo) return __sigdelset (set, signo); } -strong_alias(__sigdelset_internal,sigdelset) +libc_hidden_def(sigdelset) diff --git a/libc/signal/sigempty.c b/libc/signal/sigempty.c index 777edbdd5..e642e9335 100644 --- a/libc/signal/sigempty.c +++ b/libc/signal/sigempty.c @@ -20,7 +20,10 @@ #include <signal.h> #include <string.h> +libc_hidden_proto(memset) + /* Clear all signals from SET. */ +libc_hidden_proto(sigemptyset) int sigemptyset (set) sigset_t *set; @@ -31,7 +34,8 @@ sigemptyset (set) return -1; } - __memset (set, 0, sizeof (sigset_t)); + memset (set, 0, sizeof (sigset_t)); return 0; } +libc_hidden_def(sigemptyset) diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c index 9bf3777d5..83e47937d 100644 --- a/libc/signal/sigfillset.c +++ b/libc/signal/sigfillset.c @@ -20,9 +20,12 @@ #include <signal.h> #include <string.h> +libc_hidden_proto(memset) + /* Set all signals in SET. */ -int attribute_hidden -__sigfillset_internal (sigset_t *set) +libc_hidden_proto(sigfillset) +int +sigfillset (sigset_t *set) { if (set == NULL) { @@ -30,11 +33,7 @@ __sigfillset_internal (sigset_t *set) return -1; } -#ifdef IS_IN_libc - __memset (set, 0xff, sizeof (sigset_t)); -#else memset (set, 0xff, sizeof (sigset_t)); -#endif /* If the implementation uses a cancellation signal don't set the bit. */ #ifdef SIGCANCEL @@ -47,4 +46,4 @@ __sigfillset_internal (sigset_t *set) return 0; } -strong_alias(__sigfillset_internal,sigfillset) +libc_hidden_def(sigfillset) diff --git a/libc/signal/siggetmask.c b/libc/signal/siggetmask.c index 18e3d367d..d3af43a12 100644 --- a/libc/signal/siggetmask.c +++ b/libc/signal/siggetmask.c @@ -17,13 +17,15 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define __UCLIBC_HIDE_DEPRECATED__ #include <signal.h> -extern int __sigblock (int __mask) __THROW /*__attribute_deprecated__*/ attribute_hidden; +libc_hidden_proto(sigblock) + int siggetmask (void) { - return __sigblock (0); + return sigblock (0); } link_warning (siggetmask, diff --git a/libc/signal/sighold.c b/libc/signal/sighold.c index 29b452f63..335af4a34 100644 --- a/libc/signal/sighold.c +++ b/libc/signal/sighold.c @@ -20,9 +20,11 @@ #define __need_NULL #include <stddef.h> -#define _GNU_SOURCE #include <signal.h> +libc_hidden_proto(sigprocmask) +libc_hidden_proto(sigaddset) + int sighold (sig) int sig; @@ -30,7 +32,7 @@ sighold (sig) sigset_t set; /* Retrieve current signal set. */ - if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0) + if (sigprocmask (SIG_SETMASK, NULL, &set) < 0) return -1; /* Add the specified signal. */ @@ -38,5 +40,5 @@ sighold (sig) return -1; /* Set the new mask. */ - return __sigprocmask (SIG_SETMASK, &set, NULL); + return sigprocmask (SIG_SETMASK, &set, NULL); } diff --git a/libc/signal/sigignore.c b/libc/signal/sigignore.c index 3f8b8985f..c4d347f8d 100644 --- a/libc/signal/sigignore.c +++ b/libc/signal/sigignore.c @@ -18,15 +18,13 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define sigaction __sigaction - -#define _GNU_SOURCE #include <errno.h> #define __need_NULL #include <stddef.h> #include <signal.h> #include <string.h> /* For the real memset prototype. */ +libc_hidden_proto(sigaction) int sigignore (sig) diff --git a/libc/signal/sigintr.c b/libc/signal/sigintr.c index 797c52843..a977e22de 100644 --- a/libc/signal/sigintr.c +++ b/libc/signal/sigintr.c @@ -16,22 +16,25 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define sigaction __sigaction - #include <stddef.h> #include <signal.h> #include <errno.h> +libc_hidden_proto(sigaction) + /* 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. */ +#endif + int siginterrupt (sig, interrupt) int sig; int interrupt; { #ifdef SA_RESTART - extern sigset_t _sigintr attribute_hidden; /* Defined in signal.c. */ struct sigaction action; if (sigaction (sig, (struct sigaction *) NULL, &action) < 0) diff --git a/libc/signal/sigisempty.c b/libc/signal/sigisempty.c index 6d1de45a8..22baa0038 100644 --- a/libc/signal/sigisempty.c +++ b/libc/signal/sigisempty.c @@ -17,7 +17,6 @@ 02111-1307 USA. */ #include <errno.h> -#define __USE_GNU #include <signal.h> #define __need_NULL #include <stddef.h> diff --git a/libc/signal/sigjmp.c b/libc/signal/sigjmp.c index 37f19595a..38892e050 100644 --- a/libc/signal/sigjmp.c +++ b/libc/signal/sigjmp.c @@ -19,15 +19,19 @@ #include <stddef.h> #include <setjmp.h> #include <signal.h> +#include <libc-internal.h> + +libc_hidden_proto(sigprocmask) /* This function is called by the `sigsetjmp' macro before doing a `__setjmp' on ENV[0].__jmpbuf. Always return zero. */ +int __sigjmp_save (sigjmp_buf env, int savemask) attribute_hidden; int __sigjmp_save (sigjmp_buf env, int savemask) { env[0].__mask_was_saved = (savemask && - __sigprocmask (SIG_BLOCK, (sigset_t *) NULL, &env[0].__saved_mask) == 0); + sigprocmask (SIG_BLOCK, (sigset_t *) NULL, &env[0].__saved_mask) == 0); return 0; } diff --git a/libc/signal/signal.c b/libc/signal/signal.c index bcc31c0bc..991a14f1b 100644 --- a/libc/signal/signal.c +++ b/libc/signal/signal.c @@ -18,18 +18,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define sigaction __sigaction - #include <errno.h> #include <signal.h> #include <string.h> /* For the real memset prototype. */ +libc_hidden_proto(sigaction) sigset_t _sigintr attribute_hidden; /* Set by siginterrupt. */ /* Set the handler for the signal SIG to HANDLER, returning the old handler, or SIG_ERR on error. */ -__sighandler_t +extern __typeof(bsd_signal) __bsd_signal; +attribute_hidden __sighandler_t __bsd_signal (int sig, __sighandler_t handler) { struct sigaction act, oact; @@ -51,6 +51,7 @@ __bsd_signal (int sig, __sighandler_t handler) return oact.sa_handler; } -weak_alias (__bsd_signal, bsd_signal) -hidden_weak_alias (__bsd_signal, __signal) -weak_alias (__bsd_signal, signal) +strong_alias(__bsd_signal,bsd_signal) +libc_hidden_proto(signal) +strong_alias(__bsd_signal,signal) +libc_hidden_def(signal) diff --git a/libc/signal/sigorset.c b/libc/signal/sigorset.c index ffabf3704..7d7bf863d 100644 --- a/libc/signal/sigorset.c +++ b/libc/signal/sigorset.c @@ -17,7 +17,6 @@ 02111-1307 USA. */ #include <errno.h> -#define __USE_GNU #include <signal.h> #define __need_NULL #include <stddef.h> diff --git a/libc/signal/sigpause.c b/libc/signal/sigpause.c index 7e0852dbc..8c99af0a1 100644 --- a/libc/signal/sigpause.c +++ b/libc/signal/sigpause.c @@ -17,25 +17,30 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define sigdelset __sigdelset_internal -#define sigsuspend __sigsuspend - +#define __UCLIBC_HIDE_DEPRECATED__ +/* psm: need the BSD version of sigpause here */ #include <errno.h> +#define __FAVOR_BSD #include <signal.h> #include <stddef.h> /* For NULL. */ +libc_hidden_proto(sigprocmask) +libc_hidden_proto(sigdelset) +libc_hidden_proto(sigsuspend) + #include "sigset-cvt-mask.h" /* Set the mask of blocked signals to MASK, wait for a signal to arrive, and then restore the mask. */ -int attribute_hidden __sigpause_internal (int sig_or_mask, int is_sig) +libc_hidden_proto(__sigpause) +int __sigpause (int sig_or_mask, int is_sig) { sigset_t set; if (is_sig != 0) { /* The modern X/Open implementation is requested. */ - if (__sigprocmask (0, NULL, &set) < 0 + if (sigprocmask (0, NULL, &set) < 0 /* Yes, we call `sigdelset' and not `__sigdelset'. */ || sigdelset (&set, sig_or_mask) < 0) return -1; @@ -45,14 +50,16 @@ int attribute_hidden __sigpause_internal (int sig_or_mask, int is_sig) return sigsuspend (&set); } -strong_alias(__sigpause_internal,__sigpause) +libc_hidden_def(__sigpause) #undef sigpause /* We have to provide a default version of this function since the standards demand it. The version which is a bit more reasonable is the BSD version. So make this the default. */ +libc_hidden_proto(sigpause) int sigpause (int mask) { - return __sigpause_internal (mask, 0); + return __sigpause (mask, 0); } +libc_hidden_def(sigpause) diff --git a/libc/signal/sigrelse.c b/libc/signal/sigrelse.c index e2fa775bd..a1d5a8849 100644 --- a/libc/signal/sigrelse.c +++ b/libc/signal/sigrelse.c @@ -18,13 +18,13 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define sigdelset __sigdelset_internal - #define __need_NULL #include <stddef.h> -#define _GNU_SOURCE #include <signal.h> +libc_hidden_proto(sigprocmask) +libc_hidden_proto(sigdelset) + int sigrelse (sig) int sig; @@ -32,7 +32,7 @@ sigrelse (sig) sigset_t set; /* Retrieve current signal set. */ - if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0) + if (sigprocmask (SIG_SETMASK, NULL, &set) < 0) return -1; /* Remove the specified signal. */ @@ -40,5 +40,5 @@ sigrelse (sig) return -1; /* Set the new mask. */ - return __sigprocmask (SIG_SETMASK, &set, NULL); + return sigprocmask (SIG_SETMASK, &set, NULL); } diff --git a/libc/signal/sigset.c b/libc/signal/sigset.c index 305cd96fb..5d8c0d0bd 100644 --- a/libc/signal/sigset.c +++ b/libc/signal/sigset.c @@ -16,15 +16,14 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define sigaction __sigaction - #include <errno.h> #define __need_NULL #include <stddef.h> -#define __USE_XOPEN_EXTENDED #include <signal.h> #include <string.h> /* For the real memset prototype. */ +libc_hidden_proto(sigaction) +libc_hidden_proto(sigprocmask) /* Set the disposition for SIG. */ __sighandler_t @@ -48,7 +47,7 @@ sigset (sig, disp) return SIG_ERR; /* Add the signal set to the current signal mask. */ - if (__sigprocmask (SIG_BLOCK, &set, NULL) < 0) + if (sigprocmask (SIG_BLOCK, &set, NULL) < 0) return SIG_ERR; return SIG_HOLD; @@ -78,7 +77,7 @@ sigset (sig, disp) return SIG_ERR; /* Remove the signal set from the current signal mask. */ - if (__sigprocmask (SIG_UNBLOCK, &set, NULL) < 0) + if (sigprocmask (SIG_UNBLOCK, &set, NULL) < 0) return SIG_ERR; return oact.sa_handler; diff --git a/libc/signal/sigsetmask.c b/libc/signal/sigsetmask.c index 56d7eccfa..2c074674d 100644 --- a/libc/signal/sigsetmask.c +++ b/libc/signal/sigsetmask.c @@ -16,24 +16,28 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define __UCLIBC_HIDE_DEPRECATED__ #include <errno.h> #include <signal.h> +libc_hidden_proto(sigprocmask) + #include "sigset-cvt-mask.h" /* Set the mask of blocked signals to MASK, returning the old mask. */ -int attribute_hidden -__sigsetmask (int mask) +libc_hidden_proto(sigsetmask) +int +sigsetmask (int mask) { sigset_t set, oset; if (sigset_set_old_mask (&set, mask) < 0) return -1; - if (__sigprocmask (SIG_SETMASK, &set, &oset) < 0) + if (sigprocmask (SIG_SETMASK, &set, &oset) < 0) return -1; return sigset_get_old_mask (&oset); } -weak_alias(__sigsetmask,sigsetmask) +libc_hidden_def(sigsetmask) diff --git a/libc/signal/sigsetops.c b/libc/signal/sigsetops.c index 0317662a1..6f1ae5c83 100644 --- a/libc/signal/sigsetops.c +++ b/libc/signal/sigsetops.c @@ -8,4 +8,4 @@ # define __USE_EXTERN_INLINES 1 #endif -#include "signal.h" +#include <signal.h> diff --git a/libc/signal/sigwait.c b/libc/signal/sigwait.c index c8a93dfb2..8ff2541a0 100644 --- a/libc/signal/sigwait.c +++ b/libc/signal/sigwait.c @@ -1,8 +1,7 @@ /* vi: set sw=4 ts=4: */ /* sigwait * - * Copyright (C) 2006 by Steven J. Hill <sjhill@realitydiluted.com> - * Copyright (C) 2003-2005 by Erik Andersen <andersen@uclibc.org> + * Copyright (C) 2003 by Erik Andersen <andersen@uclibc.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,89 +18,15 @@ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA. */ -#define sigwaitinfo __sigwaitinfo - #include <errno.h> #include <signal.h> #include <string.h> -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -# include <sysdep-cancel.h> - -# ifdef __NR_rt_sigtimedwait - -/* Return any pending signal or wait for one for the given time. */ -static int do_sigwait(const sigset_t *set, int *sig) -{ - int ret; - -# ifdef SIGCANCEL - sigset_t tmpset; - if (set != NULL - && (__builtin_expect (__sigismember (set, SIGCANCEL), 0) -# ifdef SIGSETXID - || __builtin_expect (__sigismember (set, SIGSETXID), 0) -# endif - )) - { - /* Create a temporary mask without the bit for SIGCANCEL set. */ - // We are not copying more than we have to. -# ifdef IS_IN_libc - __memcpy(&tmpset, set, _NSIG / 8); -# else - memcpy(&tmpset, set, _NSIG / 8); -# endif - __sigdelset(&tmpset, SIGCANCEL); -# ifdef SIGSETXID - __sigdelset(&tmpset, SIGSETXID); -# endif - set = &tmpset; - } -# endif - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ -# ifdef INTERNAL_SYSCALL - INTERNAL_SYSCALL_DECL(err); - do - ret = INTERNAL_SYSCALL (rt_sigtimedwait, err, 4, set, NULL, - NULL, _NSIG / 8); - while (INTERNAL_SYSCALL_ERROR_P (ret, err) - && INTERNAL_SYSCALL_ERRNO (ret, err) == EINTR); - if (! INTERNAL_SYSCALL_ERROR_P (ret, err)) - { - *sig = ret; - ret = 0; - } -else - ret = INTERNAL_SYSCALL_ERRNO (ret, err); -# else -# error INTERNAL_SYSCALL must be defined!!! -# endif - - return ret; -} +libc_hidden_proto(sigwaitinfo) +int __sigwait (const sigset_t *set, int *sig) attribute_hidden; int __sigwait (const sigset_t *set, int *sig) { - if(SINGLE_THREAD_P) - return do_sigwait(set, sig); - - int oldtype = LIBC_CANCEL_ASYNC(); - - int result = do_sigwait(set, sig); - - LIBC_CANCEL_RESET(oldtype); - - return result; -} -# else -# error We must have rt_sigtimedwait defined!!! -# endif -#else -# undef sigwait -int attribute_hidden __sigwait (const sigset_t *set, int *sig) -{ int ret = 1; if ((ret = sigwaitinfo(set, NULL)) != -1) { *sig = ret; @@ -109,5 +34,6 @@ int attribute_hidden __sigwait (const sigset_t *set, int *sig) } return 1; } -#endif -weak_alias(__sigwait, sigwait) +libc_hidden_proto(sigwait) +weak_alias(__sigwait,sigwait) +libc_hidden_def(sigwait) diff --git a/libc/signal/sysv_signal.c b/libc/signal/sysv_signal.c index 608aef235..97857a250 100644 --- a/libc/signal/sysv_signal.c +++ b/libc/signal/sysv_signal.c @@ -16,12 +16,11 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define sigaction __sigaction - #include <errno.h> #include <signal.h> #include <string.h> /* For the real memset prototype. */ +libc_hidden_proto(sigaction) /* Tolerate non-threads versions of Posix */ #ifndef SA_ONESHOT @@ -60,5 +59,4 @@ __sysv_signal (sig, handler) return oact.sa_handler; } - -weak_alias (__sysv_signal, sysv_signal) +strong_alias(__sysv_signal,sysv_signal) |