[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/libc/glibc/glibc-2.22/signal/Makefile b/ap/libc/glibc/glibc-2.22/signal/Makefile
new file mode 100644
index 0000000..ffff29f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/Makefile
@@ -0,0 +1,50 @@
+# Copyright (C) 1991-2015 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/>.
+
+#
+# Makefile for signal routines.
+#
+subdir := signal
+
+include ../Makeconfig
+
+headers := signal.h sys/signal.h bits/signum.h bits/sigcontext.h \
+ bits/sigaction.h bits/sigset.h bits/siginfo.h bits/sigstack.h \
+ bits/sigthread.h
+
+routines := signal raise killpg \
+ sigaction sigprocmask kill \
+ sigpending sigsuspend sigwait \
+ sigblock sigsetmask sigpause sigvec \
+ sigstack sigaltstack sigintr \
+ sigsetops sigempty sigfillset sigaddset sigdelset sigismem \
+ sigreturn \
+ siggetmask sysv_signal \
+ sigisempty sigandset sigorset \
+ allocrtsig sigtimedwait sigwaitinfo sigqueue \
+ sighold sigrelse sigignore sigset
+
+tests := tst-signal tst-sigset tst-sigsimple tst-raise tst-sigset2
+
+
+include ../Rules
+
+CFLAGS-sigpause.c = -fexceptions
+CFLAGS-sigsuspend.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sigtimedwait.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sigwait.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sigwaitinfo.c = -fexceptions -fasynchronous-unwind-tables
diff --git a/ap/libc/glibc/glibc-2.22/signal/Versions b/ap/libc/glibc/glibc-2.22/signal/Versions
new file mode 100644
index 0000000..4d86930
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/Versions
@@ -0,0 +1,54 @@
+libc {
+ GLIBC_2.0 {
+ # functions with special/multiple interfaces
+ __sigaddset; __sigdelset; __sigismember; __sysv_signal;
+
+ # functions used in inline functions or macros
+ __sigpause;
+
+ # functions used in other libraries
+ __sigaction;
+
+ # b*
+ bsd_signal;
+
+ # g*
+ gsignal;
+
+ # k*
+ kill; killpg;
+
+ # p*
+ psignal;
+
+ # r*
+ raise;
+
+ # s*
+ sigaction; sigaddset; sigaltstack; sigandset; sigblock; sigdelset;
+ sigemptyset; sigfillset; siggetmask; siginterrupt; sigisemptyset;
+ sigismember; siglongjmp; signal; sigorset; sigpause; sigpending;
+ sigprocmask; sigreturn; sigsetmask; sigstack; sigsuspend; sigvec;
+ sigwait; ssignal;
+ }
+ GLIBC_2.1 {
+ # helper functions
+ __libc_current_sigrtmin; __libc_current_sigrtmax; __libc_allocate_rtsig;
+
+ # s*
+ sighold; sigrelse; sigignore; sigset; sysv_signal;
+
+ # New RT signal functions.
+ sigqueue; sigtimedwait; sigwaitinfo;
+ }
+ GLIBC_2.1.3 {
+ # LinuxThreads needs this entry point.
+ __sigsuspend;
+ }
+ GLIBC_2.2 {
+ # Needed to provide a pointer to the XPG sigpause function.
+ __xpg_sigpause;
+ }
+ GLIBC_2.21 {
+ }
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/allocrtsig.c b/ap/libc/glibc/glibc-2.22/signal/allocrtsig.c
new file mode 100644
index 0000000..0dd0031
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/allocrtsig.c
@@ -0,0 +1,78 @@
+/* Handle real-time signal allocation. Generic version.
+ Copyright (C) 1997-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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 <signal.h>
+
+/* Another sysdeps file can #define this and then #include this file. */
+#ifndef RESERVED_SIGRT
+# define RESERVED_SIGRT 0
+#endif
+
+/* In these variables we keep track of the used variables. If the
+ platform does not support any real-time signals we will define the
+ values to some unreasonable value which will signal failing of all
+ the functions below. */
+#ifdef __SIGRTMIN
+static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT;
+static int current_rtmax = __SIGRTMAX;
+#endif
+
+/* Return number of available real-time signal with highest priority. */
+int
+__libc_current_sigrtmin (void)
+{
+#ifdef __SIGRTMIN
+ return current_rtmin;
+#else
+ return -1;
+#endif
+}
+libc_hidden_def (__libc_current_sigrtmin)
+strong_alias (__libc_current_sigrtmin, __libc_current_sigrtmin_private)
+
+/* Return number of available real-time signal with lowest priority. */
+int
+__libc_current_sigrtmax (void)
+{
+#ifdef __SIGRTMIN
+ return current_rtmax;
+#else
+ return -1;
+#endif
+}
+libc_hidden_def (__libc_current_sigrtmax)
+strong_alias (__libc_current_sigrtmax, __libc_current_sigrtmax_private)
+
+/* 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)
+{
+#ifndef __SIGRTMIN
+ return -1;
+#else
+ if (current_rtmin == -1 || current_rtmin > current_rtmax)
+ /* We don't have any more signals available. */
+ return -1;
+
+ return high ? current_rtmin++ : current_rtmax--;
+#endif
+}
+strong_alias (__libc_allocate_rtsig, __libc_allocate_rtsig_private)
diff --git a/ap/libc/glibc/glibc-2.22/signal/kill.c b/ap/libc/glibc/glibc-2.22/signal/kill.c
new file mode 100644
index 0000000..6aa8cc7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/kill.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991-2015 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>
+
+
+/* Send signal SIG to process number PID. If PID is zero,
+ send SIG to all processes in the current process's process group.
+ If PID is < -1, send SIG to all processes in process group - PID. */
+int
+__kill (pid, sig)
+ int pid;
+ int sig;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (kill)
+
+weak_alias (__kill, kill)
diff --git a/ap/libc/glibc/glibc-2.22/signal/killpg.c b/ap/libc/glibc/glibc-2.22/signal/killpg.c
new file mode 100644
index 0000000..e4b7cf5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/killpg.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-2015 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>
+
+
+/* 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. */
+int
+killpg (pgrp, sig)
+ __pid_t pgrp;
+ int sig;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (killpg)
diff --git a/ap/libc/glibc/glibc-2.22/signal/raise.c b/ap/libc/glibc/glibc-2.22/signal/raise.c
new file mode 100644
index 0000000..d917af4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/raise.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1991-2015 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 <signal.h>
+#include <errno.h>
+
+/* Raise the signal SIG. */
+int
+raise (sig)
+ int sig;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+weak_alias (raise, gsignal)
+
+stub_warning (raise)
+stub_warning (gsignal)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigaction.c b/ap/libc/glibc/glibc-2.22/signal/sigaction.c
new file mode 100644
index 0000000..f73944e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigaction.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1991-2015 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>
+
+
+/* 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. */
+int
+__sigaction (sig, act, oact)
+ int sig;
+ const struct sigaction *act;
+ struct sigaction *oact;
+{
+ if (sig <= 0 || sig >= NSIG)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ __set_errno (ENOSYS);
+ return -1;
+}
+libc_hidden_def (__sigaction)
+stub_warning (sigaction)
+
+weak_alias (__sigaction, sigaction)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigaddset.c b/ap/libc/glibc/glibc-2.22/signal/sigaddset.c
new file mode 100644
index 0000000..9f65da2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigaddset.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-2015 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 "sigsetops.h"
+
+/* Add SIGNO to SET. */
+int
+sigaddset (set, signo)
+ sigset_t *set;
+ int signo;
+{
+ if (set == NULL || signo <= 0 || signo >= NSIG)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigaddset (set, signo);
+}
+libc_hidden_def (sigaddset)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigaltstack.c b/ap/libc/glibc/glibc-2.22/signal/sigaltstack.c
new file mode 100644
index 0000000..aaaf108
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigaltstack.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1992-2015 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>
+
+/* Run signals handlers on the stack specified by SS (if not NULL).
+ If OSS is not NULL, it is filled in with the old signal stack status. */
+int
+sigaltstack (ss, oss)
+ const struct sigaltstack *ss;
+ struct sigaltstack *oss;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (sigaltstack)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigandset.c b/ap/libc/glibc/glibc-2.22/signal/sigandset.c
new file mode 100644
index 0000000..f804ab7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigandset.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991-2015 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>
+#define __need_NULL
+#include <stddef.h>
+
+/* Combine sets LEFT and RIGHT by logical AND and place result in DEST. */
+int
+sigandset (dest, left, right)
+ sigset_t *dest;
+ const sigset_t *left;
+ const sigset_t *right;
+{
+ if (dest == NULL || left == NULL || right == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigandset (dest, left, right);
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigblock.c b/ap/libc/glibc/glibc-2.22/signal/sigblock.c
new file mode 100644
index 0000000..aff495b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigblock.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991-2015 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>
+
+/* Block signals in MASK, returning the old mask. */
+int
+__sigblock (mask)
+ int mask;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (sigblock)
+
+weak_alias (__sigblock, sigblock)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigdelset.c b/ap/libc/glibc/glibc-2.22/signal/sigdelset.c
new file mode 100644
index 0000000..3546f2f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigdelset.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-2015 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 "sigsetops.h"
+
+/* Add SIGNO to SET. */
+int
+sigdelset (set, signo)
+ sigset_t *set;
+ int signo;
+{
+ if (set == NULL || signo <= 0 || signo >= NSIG)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigdelset (set, signo);
+}
+libc_hidden_def (sigdelset)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigempty.c b/ap/libc/glibc/glibc-2.22/signal/sigempty.c
new file mode 100644
index 0000000..0e5b423
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigempty.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991-2015 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 <string.h>
+
+/* Clear all signals from SET. */
+int
+sigemptyset (set)
+ sigset_t *set;
+{
+ if (set == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ memset (set, 0, sizeof (sigset_t));
+
+ return 0;
+}
+libc_hidden_def (sigemptyset)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigfillset.c b/ap/libc/glibc/glibc-2.22/signal/sigfillset.c
new file mode 100644
index 0000000..cf55a11
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigfillset.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 1991-2015 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 <string.h>
+
+/* Set all signals in SET. */
+int
+sigfillset (set)
+ sigset_t *set;
+{
+ if (set == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ memset (set, 0xff, sizeof (sigset_t));
+
+ /* If the implementation uses a cancellation signal don't set the bit. */
+#ifdef SIGCANCEL
+ __sigdelset (set, SIGCANCEL);
+#endif
+ /* Likewise for the signal to implement setxid. */
+#ifdef SIGSETXID
+ __sigdelset (set, SIGSETXID);
+#endif
+
+ return 0;
+}
+libc_hidden_def (sigfillset)
diff --git a/ap/libc/glibc/glibc-2.22/signal/siggetmask.c b/ap/libc/glibc/glibc-2.22/signal/siggetmask.c
new file mode 100644
index 0000000..329a156
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/siggetmask.c
@@ -0,0 +1,28 @@
+/* siggetmask -- useless alias for `sigblock (0)' for old Linux compatibility.
+ Copyright (C) 1996-2015 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 <signal.h>
+
+int
+siggetmask (void)
+{
+ return __sigblock (0);
+}
+
+link_warning (siggetmask,
+ "warning: `siggetmask' is obsolete; `sigprocmask' is best")
diff --git a/ap/libc/glibc/glibc-2.22/signal/sighold.c b/ap/libc/glibc/glibc-2.22/signal/sighold.c
new file mode 100644
index 0000000..3dcf330
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sighold.c
@@ -0,0 +1,40 @@
+/* Add SIG to the calling process' signal mask.
+ Copyright (C) 1998-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+ 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/>. */
+
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+
+int
+sighold (sig)
+ int sig;
+{
+ sigset_t set;
+
+ /* Retrieve current signal set. */
+ if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+ return -1;
+
+ /* Add the specified signal. */
+ if (sigaddset (&set, sig) < 0)
+ return -1;
+
+ /* Set the new mask. */
+ return __sigprocmask (SIG_SETMASK, &set, NULL);
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigignore.c b/ap/libc/glibc/glibc-2.22/signal/sigignore.c
new file mode 100644
index 0000000..67af463
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigignore.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1998-2015 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>
+
+
+/* Set the disposition for SIG to SIG_IGN. */
+int
+sigignore (sig)
+ int sig;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (sigignore)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigintr.c b/ap/libc/glibc/glibc-2.22/signal/sigintr.c
new file mode 100644
index 0000000..8f274cb
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigintr.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1992-2015 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>
+
+/* 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. */
+int
+siginterrupt (sig, interrupt)
+ int sig;
+ int interrupt;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (siginterrupt)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigisempty.c b/ap/libc/glibc/glibc-2.22/signal/sigisempty.c
new file mode 100644
index 0000000..3c60d7e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigisempty.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991-2015 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>
+#define __need_NULL
+#include <stddef.h>
+
+/* Test whether SET is empty. */
+int
+sigisemptyset (set)
+ const sigset_t *set;
+{
+ if (set == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigisemptyset (set);
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigismem.c b/ap/libc/glibc/glibc-2.22/signal/sigismem.c
new file mode 100644
index 0000000..7195229
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigismem.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-2015 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 "sigsetops.h"
+
+/* Return 1 if SIGNO is in SET, 0 if not. */
+int
+sigismember (set, signo)
+ const sigset_t *set;
+ int signo;
+{
+ if (set == NULL || signo <= 0 || signo >= NSIG)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigismember (set, signo);
+}
+libc_hidden_def (sigismember)
diff --git a/ap/libc/glibc/glibc-2.22/signal/signal.c b/ap/libc/glibc/glibc-2.22/signal/signal.c
new file mode 100644
index 0000000..a249e74
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/signal.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991-2015 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>
+
+
+/* Set the handler for the signal SIG to HANDLER,
+ returning the old handler, or SIG_ERR on error. */
+__sighandler_t
+signal (sig, handler)
+ int sig;
+ __sighandler_t handler;
+{
+ __set_errno (ENOSYS);
+ return SIG_ERR;
+}
+
+weak_alias (signal, ssignal)
+
+stub_warning (signal)
+stub_warning (ssignal)
diff --git a/ap/libc/glibc/glibc-2.22/signal/signal.h b/ap/libc/glibc/glibc-2.22/signal/signal.h
new file mode 100644
index 0000000..712cd95
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/signal.h
@@ -0,0 +1,377 @@
+/* Copyright (C) 1991-2015 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/>. */
+
+/*
+ * ISO C99 Standard: 7.14 Signal handling <signal.h>
+ */
+
+#ifndef _SIGNAL_H
+
+#if !defined __need_sig_atomic_t && !defined __need_sigset_t
+# define _SIGNAL_H
+#endif
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/sigset.h> /* __sigset_t, __sig_atomic_t. */
+
+/* An integral type that can be modified atomically, without the
+ possibility of a signal arriving in the middle of the operation. */
+#if defined __need_sig_atomic_t || defined _SIGNAL_H
+# ifndef __sig_atomic_t_defined
+# define __sig_atomic_t_defined
+__BEGIN_NAMESPACE_STD
+typedef __sig_atomic_t sig_atomic_t;
+__END_NAMESPACE_STD
+# endif
+# undef __need_sig_atomic_t
+#endif
+
+#if defined __need_sigset_t || (defined _SIGNAL_H && defined __USE_POSIX)
+# ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+# endif
+# undef __need_sigset_t
+#endif
+
+#ifdef _SIGNAL_H
+
+#include <bits/types.h>
+#include <bits/signum.h>
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+#endif
+#ifdef __USE_XOPEN
+# endif
+# ifndef __uid_t_defined
+typedef __uid_t uid_t;
+# define __uid_t_defined
+# endif
+#endif /* Unix98 */
+
+#ifdef __USE_POSIX199309
+/* We need `struct timespec' later on. */
+# define __need_timespec
+# include <time.h>
+#endif
+
+#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
+/* Get the `siginfo_t' type plus the needed symbols. */
+# include <bits/siginfo.h>
+#endif
+
+
+/* Type of a signal handler. */
+typedef void (*__sighandler_t) (int);
+
+/* The X/Open definition of `signal' specifies the SVID semantic. Use
+ the additional function `sysv_signal' when X/Open compatibility is
+ requested. */
+extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#ifdef __USE_GNU
+extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#endif
+
+/* Set the handler for the signal SIG to HANDLER, returning the old
+ handler, or SIG_ERR on error.
+ By default `signal' has the BSD semantic. */
+__BEGIN_NAMESPACE_STD
+#ifdef __USE_MISC
+extern __sighandler_t signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#else
+/* Make sure the used `signal' implementation is the SVID version. */
+# ifdef __REDIRECT_NTH
+extern __sighandler_t __REDIRECT_NTH (signal,
+ (int __sig, __sighandler_t __handler),
+ __sysv_signal);
+# else
+# define signal __sysv_signal
+# endif
+#endif
+__END_NAMESPACE_STD
+
+#ifdef __USE_XOPEN
+/* The X/Open definition of `signal' conflicts with the BSD version.
+ So they defined another function `bsd_signal'. */
+extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
+ __THROW;
+#endif
+
+/* Send signal SIG to process number PID. If PID is zero,
+ send SIG to all processes in the current process's process group.
+ If PID is < -1, send SIG to all processes in process group - PID. */
+#ifdef __USE_POSIX
+extern int kill (__pid_t __pid, int __sig) __THROW;
+#endif /* Use POSIX. */
+
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+/* 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. */
+extern int killpg (__pid_t __pgrp, int __sig) __THROW;
+#endif /* Use misc || X/Open Unix. */
+
+__BEGIN_NAMESPACE_STD
+/* Raise signal SIG, i.e., send SIG to yourself. */
+extern int raise (int __sig) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_MISC
+/* SVID names for the same things. */
+extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
+ __THROW;
+extern int gsignal (int __sig) __THROW;
+#endif /* Use misc. */
+
+#ifdef __USE_XOPEN2K8
+/* Print a message describing the meaning of the given signal number. */
+extern void psignal (int __sig, const char *__s);
+
+/* Print a message describing the meaning of the given signal information. */
+extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
+#endif /* POSIX 2008. */
+
+
+
+/* The `sigpause' function in X/Open defines the argument as the
+ signal number. This requires redirecting to another function
+ because the default version in glibc uses an old BSD interface.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+
+#ifdef __USE_XOPEN
+# ifdef __GNUC__
+extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
+# else
+extern int __sigpause (int __sig_or_mask, int __is_sig);
+/* Remove a signal from the signal mask and suspend the process. */
+# define sigpause(sig) __sigpause ((sig), 1)
+# endif
+#endif
+
+
+#ifdef __USE_MISC
+/* None of the following functions should be used anymore. They are here
+ only for compatibility. A single word (`int') is not guaranteed to be
+ enough to hold a complete signal mask and therefore these functions
+ simply do not work in many situations. Use `sigprocmask' instead. */
+
+/* Compute mask for signal SIG. */
+# define sigmask(sig) __sigmask(sig)
+
+/* Block signals in MASK, returning the old mask. */
+extern int sigblock (int __mask) __THROW __attribute_deprecated__;
+
+/* Set the mask of blocked signals to MASK, returning the old mask. */
+extern int sigsetmask (int __mask) __THROW __attribute_deprecated__;
+
+/* Return currently selected signal mask. */
+extern int siggetmask (void) __THROW __attribute_deprecated__;
+#endif /* Use misc. */
+
+
+#ifdef __USE_MISC
+# define NSIG _NSIG
+#endif
+
+#ifdef __USE_GNU
+typedef __sighandler_t sighandler_t;
+#endif
+
+/* 4.4 BSD uses the name `sig_t' for this. */
+#ifdef __USE_MISC
+typedef __sighandler_t sig_t;
+#endif
+
+#ifdef __USE_POSIX
+
+/* Clear all signals from SET. */
+extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1));
+
+/* Set all signals in SET. */
+extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1));
+
+/* Add SIGNO to SET. */
+extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
+
+/* Remove SIGNO from SET. */
+extern int sigdelset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
+
+/* Return 1 if SIGNO is in SET, 0 if not. */
+extern int sigismember (const sigset_t *__set, int __signo)
+ __THROW __nonnull ((1));
+
+# ifdef __USE_GNU
+/* Return non-empty value is SET is not empty. */
+extern int sigisemptyset (const sigset_t *__set) __THROW __nonnull ((1));
+
+/* Build new signal set by combining the two inputs set using logical AND. */
+extern int sigandset (sigset_t *__set, const sigset_t *__left,
+ const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
+
+/* Build new signal set by combining the two inputs set using logical OR. */
+extern int sigorset (sigset_t *__set, const sigset_t *__left,
+ const sigset_t *__right) __THROW __nonnull ((1, 2, 3));
+# endif /* GNU */
+
+/* Get the system-specific definitions of `struct sigaction'
+ and the `SA_*' and `SIG_*'. constants. */
+# include <bits/sigaction.h>
+
+/* Get and/or change the set of blocked signals. */
+extern int sigprocmask (int __how, const sigset_t *__restrict __set,
+ sigset_t *__restrict __oset) __THROW;
+
+/* Change the set of blocked signals to SET,
+ wait until a signal arrives, and restore the set of blocked signals.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigsuspend (const sigset_t *__set) __nonnull ((1));
+
+/* Get and/or set the action for signal SIG. */
+extern int sigaction (int __sig, const struct sigaction *__restrict __act,
+ struct sigaction *__restrict __oact) __THROW;
+
+/* Put in SET all signals that are blocked and waiting to be delivered. */
+extern int sigpending (sigset_t *__set) __THROW __nonnull ((1));
+
+
+/* Select any of pending signals from SET or wait for any to arrive.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
+ __nonnull ((1, 2));
+
+# ifdef __USE_POSIX199309
+/* Select any of pending signals from SET and place information in INFO.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigwaitinfo (const sigset_t *__restrict __set,
+ siginfo_t *__restrict __info) __nonnull ((1));
+
+/* Select any of pending signals from SET and place information in INFO.
+ Wait the time specified by TIMEOUT if no signal is pending.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int sigtimedwait (const sigset_t *__restrict __set,
+ siginfo_t *__restrict __info,
+ const struct timespec *__restrict __timeout)
+ __nonnull ((1));
+
+/* Send signal SIG to the process PID. Associate data in VAL with the
+ signal. */
+extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
+ __THROW;
+# endif /* Use POSIX 199306. */
+
+#endif /* Use POSIX. */
+
+#ifdef __USE_MISC
+
+/* Names of the signals. This variable exists only for compatibility.
+ Use `strsignal' instead (see <string.h>). */
+extern const char *const _sys_siglist[_NSIG];
+extern const char *const sys_siglist[_NSIG];
+
+
+/* Get machine-dependent `struct sigcontext' and signal subcodes. */
+# include <bits/sigcontext.h>
+
+/* Restore the state saved in SCP. */
+extern int sigreturn (struct sigcontext *__scp) __THROW;
+
+#endif /* Use misc. */
+
+
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+# define __need_size_t
+# include <stddef.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. */
+extern int siginterrupt (int __sig, int __interrupt) __THROW;
+
+# include <bits/sigstack.h>
+# if defined __USE_XOPEN || defined __USE_XOPEN2K8
+/* This will define `ucontext_t' and `mcontext_t'. */
+# include <sys/ucontext.h>
+# endif
+
+/* Run signals handlers on the stack specified by SS (if not NULL).
+ If OSS is not NULL, it is filled in with the old signal stack status.
+ This interface is obsolete and on many platform not implemented. */
+extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
+ __THROW __attribute_deprecated__;
+
+/* Alternate signal handler stack interface.
+ This interface should always be preferred over `sigstack'. */
+extern int sigaltstack (const struct sigaltstack *__restrict __ss,
+ struct sigaltstack *__restrict __oss) __THROW;
+
+#endif /* Use POSIX.1-2008 or X/Open Unix. */
+
+#ifdef __USE_XOPEN_EXTENDED
+/* Simplified interface for signal management. */
+
+/* Add SIG to the calling process' signal mask. */
+extern int sighold (int __sig) __THROW;
+
+/* Remove SIG from the calling process' signal mask. */
+extern int sigrelse (int __sig) __THROW;
+
+/* Set the disposition of SIG to SIG_IGN. */
+extern int sigignore (int __sig) __THROW;
+
+/* Set the disposition of SIG. */
+extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW;
+#endif
+
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
+/* Some of the functions for handling signals in threaded programs must
+ be defined here. */
+# include <bits/pthreadtypes.h>
+# include <bits/sigthread.h>
+#endif /* use Unix98 */
+
+/* The following functions are used internally in the C library and in
+ other code which need deep insights. */
+
+/* Return number of available real-time signal with highest priority. */
+extern int __libc_current_sigrtmin (void) __THROW;
+/* Return number of available real-time signal with lowest priority. */
+extern int __libc_current_sigrtmax (void) __THROW;
+
+#endif /* signal.h */
+
+__END_DECLS
+
+#endif /* not signal.h */
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigorset.c b/ap/libc/glibc/glibc-2.22/signal/sigorset.c
new file mode 100644
index 0000000..f49d978
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigorset.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991-2015 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>
+#define __need_NULL
+#include <stddef.h>
+
+/* Combine sets LEFT and RIGHT by logical OR and place result in DEST. */
+int
+sigorset (dest, left, right)
+ sigset_t *dest;
+ const sigset_t *left;
+ const sigset_t *right;
+{
+ if (dest == NULL || left == NULL || right == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigorset (dest, left, right);
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigpause.c b/ap/libc/glibc/glibc-2.22/signal/sigpause.c
new file mode 100644
index 0000000..390329c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigpause.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 1991-2015 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/>. */
+
+#define sigpause __rename_sigpause
+#include <errno.h>
+#include <signal.h>
+#undef sigpause
+
+int
+__sigpause (sig_or_mask, is_sig)
+ int sig_or_mask;
+ int is_sig;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (__sigpause)
+libc_hidden_def (__sigpause)
+
+int
+__attribute__ ((weak))
+__default_sigpause (int mask)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+weak_alias (__default_sigpause, sigpause)
+stub_warning (sigpause)
+
+
+int
+__attribute ((weak))
+__xpg___sigpause (int sig)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigpending.c b/ap/libc/glibc/glibc-2.22/signal/sigpending.c
new file mode 100644
index 0000000..104f6a3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigpending.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991-2015 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 <stddef.h>
+#include <signal.h>
+
+
+/* Store in SET all signals that are blocked and pending. */
+int
+sigpending (set)
+ sigset_t *set;
+{
+ if (set == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (sigpending)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigprocmask.c b/ap/libc/glibc/glibc-2.22/signal/sigprocmask.c
new file mode 100644
index 0000000..33fb241
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigprocmask.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991-2015 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>
+
+
+/* If SET is not NULL, modify the current set of blocked signals
+ according to HOW, which may be SIG_BLOCK, SIG_UNBLOCK or SIG_SETMASK.
+ If OSET is not NULL, store the old set of blocked signals in *OSET. */
+int
+__sigprocmask (how, set, oset)
+ int how;
+ const sigset_t *set;
+ sigset_t *oset;
+{
+ switch (how)
+ {
+ case SIG_BLOCK:
+ case SIG_UNBLOCK:
+ case SIG_SETMASK:
+ break;
+ default:
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+/* No stub warning because abort calls __sigprocmask,
+ and we don't want warnings for every use of abort on
+ a system without safe signals. */
+
+weak_alias (__sigprocmask, sigprocmask)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigqueue.c b/ap/libc/glibc/glibc-2.22/signal/sigqueue.c
new file mode 100644
index 0000000..532934d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigqueue.c
@@ -0,0 +1,31 @@
+/* Implementation of sigqueue function from POSIX.1b.
+ Copyright (C) 1997-2015 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 <sys/types.h>
+
+int
+__sigqueue (pid_t pid, int sig, const union sigval val)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+weak_alias (__sigqueue, sigqueue)
+
+stub_warning (sigqueue)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigrelse.c b/ap/libc/glibc/glibc-2.22/signal/sigrelse.c
new file mode 100644
index 0000000..56c535c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigrelse.c
@@ -0,0 +1,40 @@
+/* Remove SIG from the calling process' signal mask.
+ Copyright (C) 1998-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+ 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/>. */
+
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+
+int
+sigrelse (sig)
+ int sig;
+{
+ sigset_t set;
+
+ /* Retrieve current signal set. */
+ if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+ return -1;
+
+ /* Remove the specified signal. */
+ if (sigdelset (&set, sig) < 0)
+ return -1;
+
+ /* Set the new mask. */
+ return __sigprocmask (SIG_SETMASK, &set, NULL);
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigreturn.c b/ap/libc/glibc/glibc-2.22/signal/sigreturn.c
new file mode 100644
index 0000000..88f223f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigreturn.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1992-2015 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 <signal.h>
+#include <errno.h>
+
+int
+__sigreturn (context)
+ struct sigcontext *context;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (sigreturn)
+
+weak_alias (__sigreturn, sigreturn)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigset.c b/ap/libc/glibc/glibc-2.22/signal/sigset.c
new file mode 100644
index 0000000..37c549e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigset.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1998-2015 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>
+
+
+/* Set the disposition for SIG. */
+__sighandler_t
+sigset (sig, disp)
+ int sig;
+ __sighandler_t disp;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (sigset)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigsetmask.c b/ap/libc/glibc/glibc-2.22/signal/sigsetmask.c
new file mode 100644
index 0000000..fc27bd4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigsetmask.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991-2015 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>
+
+int
+__sigsetmask (mask)
+ int mask;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+stub_warning (sigsetmask)
+
+weak_alias (__sigsetmask, sigsetmask)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigsetops.c b/ap/libc/glibc/glibc-2.22/signal/sigsetops.c
new file mode 100644
index 0000000..0317662
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigsetops.c
@@ -0,0 +1,11 @@
+/* Define the real-function versions of all inline functions
+ defined in signal.h (or bits/sigset.h). */
+
+#include <features.h>
+
+#define _EXTERN_INLINE
+#ifndef __USE_EXTERN_INLINES
+# define __USE_EXTERN_INLINES 1
+#endif
+
+#include "signal.h"
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigsetops.h b/ap/libc/glibc/glibc-2.22/signal/sigsetops.h
new file mode 100644
index 0000000..e1f981f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigsetops.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 1991-2015 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/>. */
+
+/* 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/ap/libc/glibc/glibc-2.22/signal/sigstack.c b/ap/libc/glibc/glibc-2.22/signal/sigstack.c
new file mode 100644
index 0000000..4704a56
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigstack.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1991-2015 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>
+
+/* Run signals handlers on the stack specified by SS (if not NULL).
+ If OSS is not NULL, it is filled in with the old signal stack status. */
+int
+sigstack (ss, oss)
+ struct sigstack *ss;
+ struct sigstack *oss;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+
+stub_warning (sigstack)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigsuspend.c b/ap/libc/glibc/glibc-2.22/signal/sigsuspend.c
new file mode 100644
index 0000000..cb4ece8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigsuspend.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991-2015 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>
+
+
+/* Change the set of blocked signals to SET,
+ wait until a signal arrives, and restore the set of blocked signals. */
+int
+__sigsuspend (set)
+ const sigset_t *set;
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+libc_hidden_def (__sigsuspend)
+weak_alias (__sigsuspend, sigsuspend)
+
+stub_warning (sigsuspend)
+stub_warning (__sigsuspend)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigtimedwait.c b/ap/libc/glibc/glibc-2.22/signal/sigtimedwait.c
new file mode 100644
index 0000000..2b21921
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigtimedwait.c
@@ -0,0 +1,32 @@
+/* Implementation of sigtimedwait function from POSIX.1b.
+ Copyright (C) 1997-2015 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>
+
+int
+__sigtimedwait (const sigset_t *set, siginfo_t *info,
+ const struct timespec *timeout)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+libc_hidden_def (__sigtimedwait)
+weak_alias (__sigtimedwait, sigtimedwait)
+
+stub_warning (sigtimedwait)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigvec.c b/ap/libc/glibc/glibc-2.22/signal/sigvec.c
new file mode 100644
index 0000000..1f9395e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigvec.c
@@ -0,0 +1,203 @@
+/* ABI compatibility for obsolete sigvec function from 4.2BSD.
+ Copyright (C) 1991-2015 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 <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_21)
+
+# include <signal.h>
+# include <errno.h>
+# include <stddef.h>
+
+
+/* These are the struct sigvec and SV_* bit definitions that
+ used to be in <signal.h>. The whole interface now exists
+ solely for ABI compatibility, so it can just be here. */
+struct sigvec
+ {
+ __sighandler_t sv_handler; /* Signal handler. */
+ int sv_mask; /* Mask of signals to be blocked. */
+
+ int sv_flags; /* Flags (see below). */
+ };
+# define SV_ONSTACK (1 << 0)/* Take the signal on the signal stack. */
+# define SV_INTERRUPT (1 << 1)/* Do not restart system calls. */
+# define SV_RESETHAND (1 << 2)/* Reset handler to SIG_DFL on receipt. */
+
+
+/* Include macros to convert between `sigset_t' and old-style mask. */
+# include <sigset-cvt-mask.h>
+
+# ifndef SA_RESETHAND
+/* When sigaction lacks the extension bit for it,
+ we use a wrapper handler to support SV_RESETHAND. */
+struct sigvec_wrapper_data
+{
+ __sighandler_t sw_handler;
+ unsigned int sw_mask;
+};
+
+static void sigvec_wrapper_handler (int sig) __THROW;
+
+static struct sigvec_wrapper_data sigvec_wrapper_data[NSIG];
+# endif
+
+
+/* If VEC is non-NULL, set the handler for SIG to the `sv_handler' member
+ of VEC. The signals in `sv_mask' will be blocked while the handler runs.
+ If the SV_RESETHAND bit is set in `sv_flags', the handler for SIG will be
+ reset to SIG_DFL before `sv_handler' is entered. If OVEC is non-NULL,
+ it is filled in with the old information for SIG. */
+int
+__sigvec (int sig,
+ const struct sigvec *vec,
+ struct sigvec *ovec)
+{
+ struct sigaction old;
+
+# ifndef SA_RESETHAND
+ if (vec == NULL || !(vec->sv_flags & SV_RESETHAND))
+# endif
+ {
+ struct sigaction new, *n;
+
+ if (vec == NULL)
+ n = NULL;
+ else
+ {
+ __sighandler_t handler;
+ unsigned int mask;
+ unsigned int sv_flags;
+ unsigned int sa_flags;
+
+ handler = vec->sv_handler;
+ mask = vec->sv_mask;
+ sv_flags = vec->sv_flags;
+ sa_flags = 0;
+ if (sv_flags & SV_ONSTACK)
+ {
+# ifdef SA_ONSTACK
+ sa_flags |= SA_ONSTACK;
+# else
+ __set_errno (ENOSYS);
+ return -1;
+# endif
+ }
+# ifdef SA_RESTART
+ if (!(sv_flags & SV_INTERRUPT))
+ sa_flags |= SA_RESTART;
+# endif
+# ifdef SA_RESETHAND
+ if (sv_flags & SV_RESETHAND)
+ sa_flags |= SA_RESETHAND;
+# endif
+ n = &new;
+ new.sa_handler = handler;
+ if (sigset_set_old_mask (&new.sa_mask, mask) < 0)
+ return -1;
+ new.sa_flags = sa_flags;
+ }
+
+ if (__sigaction (sig, n, &old) < 0)
+ return -1;
+ }
+# ifndef SA_RESETHAND
+ else
+ {
+ __sighandler_t handler;
+ unsigned int mask;
+ struct sigvec_wrapper_data *data;
+ struct sigaction wrapper;
+
+ handler = vec->sv_handler;
+ mask = (unsigned int)vec->sv_mask;
+ data = &sigvec_wrapper_data[sig];
+ wrapper.sa_handler = sigvec_wrapper_handler;
+ /* FIXME: should we set wrapper.sa_mask, wrapper.sa_flags?? */
+ data->sw_handler = handler;
+ data->sw_mask = mask;
+
+ if (__sigaction (sig, &wrapper, &old) < 0)
+ return -1;
+ }
+# endif
+
+ if (ovec != NULL)
+ {
+ __sighandler_t handler;
+ unsigned int sv_flags;
+ unsigned int sa_flags;
+ unsigned int mask;
+
+ handler = old.sa_handler;
+ sv_flags = 0;
+ sa_flags = old.sa_flags;
+# ifndef SA_RESETHAND
+ if (handler == sigvec_wrapper_handler)
+ {
+ handler = sigvec_wrapper_data[sig].sw_handler;
+ /* should we use data->sw_mask?? */
+ sv_flags |= SV_RESETHAND;
+ }
+# else
+ if (sa_flags & SA_RESETHAND)
+ sv_flags |= SV_RESETHAND;
+# endif
+ mask = sigset_get_old_mask (&old.sa_mask);
+# ifdef SA_ONSTACK
+ if (sa_flags & SA_ONSTACK)
+ sv_flags |= SV_ONSTACK;
+# endif
+# ifdef SA_RESTART
+ if (!(sa_flags & SA_RESTART))
+# endif
+ sv_flags |= SV_INTERRUPT;
+ ovec->sv_handler = handler;
+ ovec->sv_mask = (int)mask;
+ ovec->sv_flags = (int)sv_flags;
+ }
+
+ return 0;
+}
+
+compat_symbol (libc, __sigvec, sigvec, GLIBC_2_0);
+
+# ifndef SA_RESETHAND
+static void
+sigvec_wrapper_handler (sig)
+ int sig;
+{
+ struct sigvec_wrapper_data *data;
+ struct sigaction act;
+ int save;
+ __sighandler_t handler;
+
+ data = &sigvec_wrapper_data[sig];
+ act.sa_handler = SIG_DFL;
+ act.sa_flags = 0;
+ sigset_set_old_mask (&act.sa_mask, data->sw_mask);
+ handler = data->sw_handler;
+ save = errno;
+ (void) __sigaction (sig, &act, (struct sigaction *) NULL);
+ __set_errno (save);
+
+ (*handler) (sig);
+}
+# endif /* No SA_RESETHAND. */
+
+#endif /* SHLIB_COMPAT */
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigwait.c b/ap/libc/glibc/glibc-2.22/signal/sigwait.c
new file mode 100644
index 0000000..e0e0dc4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigwait.c
@@ -0,0 +1,30 @@
+/* sigwait - implementation of sigwait function from POSIX.1c.
+ Copyright (C) 1996-2015 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>
+
+int
+__sigwait (const sigset_t *set, int *sig)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+weak_alias (__sigwait, sigwait)
+
+stub_warning (sigwait)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sigwaitinfo.c b/ap/libc/glibc/glibc-2.22/signal/sigwaitinfo.c
new file mode 100644
index 0000000..4125761
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sigwaitinfo.c
@@ -0,0 +1,31 @@
+/* Implementation of sigwaitinfo function from POSIX.1b.
+ Copyright (C) 1997-2015 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>
+
+int
+__sigwaitinfo (const sigset_t *set, siginfo_t *info)
+{
+ __set_errno (ENOSYS);
+ return -1;
+}
+libc_hidden_def (__sigwaitinfo)
+weak_alias (__sigwaitinfo, sigwaitinfo)
+
+stub_warning (sigwaitinfo)
diff --git a/ap/libc/glibc/glibc-2.22/signal/sys/signal.h b/ap/libc/glibc/glibc-2.22/signal/sys/signal.h
new file mode 100644
index 0000000..2e602da
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sys/signal.h
@@ -0,0 +1 @@
+#include <signal.h>
diff --git a/ap/libc/glibc/glibc-2.22/signal/sysv_signal.c b/ap/libc/glibc/glibc-2.22/signal/sysv_signal.c
new file mode 100644
index 0000000..0312696
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/sysv_signal.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991-2015 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>
+
+/* Set the handler for the signal SIG to HANDLER,
+ returning the old handler, or SIG_ERR on error. */
+__sighandler_t
+__sysv_signal (sig, handler)
+ int sig;
+ __sighandler_t handler;
+{
+ /* Check signal extents to protect __sigismember. */
+ if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
+ {
+ __set_errno (EINVAL);
+ return SIG_ERR;
+ }
+
+ __set_errno (ENOSYS);
+
+ return SIG_ERR;
+}
+weak_alias (__sysv_signal, sysv_signal)
+
+stub_warning (sysv_signal)
diff --git a/ap/libc/glibc/glibc-2.22/signal/tst-raise.c b/ap/libc/glibc/glibc-2.22/signal/tst-raise.c
new file mode 100644
index 0000000..9f6abdc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/tst-raise.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
+
+ 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 <error.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+volatile int count;
+
+void
+sh (int sig)
+{
+ ++count;
+}
+
+int
+main (void)
+{
+ struct sigaction sa;
+ sa.sa_handler = sh;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+ if (sigaction (SIGUSR1, &sa, NULL) < 0)
+ {
+ printf ("sigaction failed: %m\n");
+ exit (1);
+ }
+ if (raise (SIGUSR1) < 0)
+ {
+ printf ("first raise failed: %m\n");
+ exit (1);
+ }
+ if (raise (SIGUSR1) < 0)
+ {
+ printf ("second raise failed: %m\n");
+ exit (1);
+ }
+ if (count != 2)
+ {
+ printf ("signal handler not called 2 times\n");
+ exit (1);
+ }
+ exit (0);
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/tst-signal.c b/ap/libc/glibc/glibc-2.22/signal/tst-signal.c
new file mode 100644
index 0000000..6d31787
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/tst-signal.c
@@ -0,0 +1,44 @@
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int win = 0;
+
+static void
+handler (int sig)
+{
+ printf ("Received signal %d (%s).\n", sig, strsignal(sig));
+ win = 1;
+}
+
+int
+main (void)
+{
+ if (signal (SIGTERM, handler) == SIG_ERR)
+ {
+ perror ("signal: SIGTERM");
+ exit (EXIT_FAILURE);
+ }
+
+ puts ("Set handler.");
+
+ printf ("Sending myself signal %d.\n", SIGTERM);
+ fflush (stdout);
+
+ if (raise (SIGTERM) < 0)
+ {
+ perror ("raise: SIGTERM");
+ exit (EXIT_FAILURE);
+ }
+
+ if (!win)
+ {
+ puts ("Didn't get any signal. Test FAILED!");
+ exit (EXIT_FAILURE);
+ }
+
+ puts ("Got a signal. Test succeeded.");
+
+ return EXIT_SUCCESS;
+}
diff --git a/ap/libc/glibc/glibc-2.22/signal/tst-sigset.c b/ap/libc/glibc/glibc-2.22/signal/tst-sigset.c
new file mode 100644
index 0000000..d47adcc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/tst-sigset.c
@@ -0,0 +1,43 @@
+/* Test sig*set functions. */
+
+#include <signal.h>
+#include <stdio.h>
+
+#define TEST_FUNCTION do_test ()
+static int
+do_test (void)
+{
+ int result = 0;
+ int sig = -1;
+
+#define TRY(call) \
+ if (call) \
+ { \
+ printf ("%s (sig = %d): %m\n", #call, sig); \
+ result = 1; \
+ } \
+ else
+
+
+ sigset_t set;
+ TRY (sigemptyset (&set) != 0);
+
+#ifdef SIGRTMAX
+ int max_sig = SIGRTMAX;
+#else
+ int max_sig = NSIG - 1;
+#endif
+
+ for (sig = 1; sig <= max_sig; ++sig)
+ {
+ TRY (sigismember (&set, sig) != 0);
+ TRY (sigaddset (&set, sig) != 0);
+ TRY (sigismember (&set, sig) == 0);
+ TRY (sigdelset (&set, sig) != 0);
+ TRY (sigismember (&set, sig) != 0);
+ }
+
+ return result;
+}
+
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.22/signal/tst-sigset2.c b/ap/libc/glibc/glibc-2.22/signal/tst-sigset2.c
new file mode 100644
index 0000000..f653323
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/tst-sigset2.c
@@ -0,0 +1,184 @@
+/* sigset_SIG_HOLD_bug.c [BZ #1951] */
+#include <errno.h>
+#include <error.h>
+#include <inttypes.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define TEST_SIG SIGINT
+
+
+/* Print mask of blocked signals for this process */
+static void
+printSigMask (const char *msg)
+{
+ sigset_t currMask;
+ int sig;
+ int cnt;
+
+ if (msg != NULL)
+ printf ("%s", msg);
+
+ if (sigprocmask (SIG_BLOCK, NULL, &currMask) == -1)
+ error (1, errno, "sigaction");
+
+ cnt = 0;
+ for (sig = 1; sig < NSIG; sig++)
+ {
+ if (sigismember (&currMask, sig))
+ {
+ cnt++;
+ printf ("\t\t%d (%s)\n", sig, strsignal (sig));
+ }
+ }
+
+ if (cnt == 0)
+ printf ("\t\t<empty signal set>\n");
+} /* printSigMask */
+
+static void
+handler (int sig)
+{
+ printf ("Caught signal %d\n", sig);
+ printSigMask ("Signal mask in handler\n");
+ printf ("Handler returning\n");
+ _exit (1);
+} /* handler */
+
+static void
+printDisposition (sighandler_t disp)
+{
+ if (disp == SIG_HOLD)
+ printf ("SIG_HOLD");
+ else if (disp == SIG_DFL)
+ printf ("SIG_DFL");
+ else if (disp == SIG_IGN)
+ printf ("SIG_IGN");
+ else
+ printf ("handled at %" PRIxPTR, (uintptr_t) disp);
+} /* printDisposition */
+
+static int
+returnTest1 (void)
+{
+ sighandler_t prev;
+
+ printf ("===== TEST 1 =====\n");
+ printf ("Blocking signal with sighold()\n");
+ if (sighold (TEST_SIG) == -1)
+ error (1, errno, "sighold");
+ printSigMask ("Signal mask after sighold()\n");
+
+ printf ("About to use sigset() to establish handler\n");
+ prev = sigset (TEST_SIG, handler);
+ if (prev == SIG_ERR)
+ error(1, errno, "sigset");
+
+ printf ("Previous disposition: ");
+ printDisposition (prev);
+ printf (" (should be SIG_HOLD)\n");
+ if (prev != SIG_HOLD)
+ {
+ printf("TEST FAILED!!!\n");
+ return 1;
+ }
+ return 0;
+} /* returnTest1 */
+
+static int
+returnTest2 (void)
+{
+ sighandler_t prev;
+
+ printf ("\n===== TEST 2 =====\n");
+
+ printf ("About to use sigset() to set SIG_HOLD\n");
+ prev = sigset (TEST_SIG, SIG_HOLD);
+ if (prev == SIG_ERR)
+ error (1, errno, "sigset");
+
+ printf ("Previous disposition: ");
+ printDisposition (prev);
+ printf (" (should be SIG_DFL)\n");
+ if (prev != SIG_DFL)
+ {
+ printf("TEST FAILED!!!\n");
+ return 1;
+ }
+ return 0;
+} /* returnTest2 */
+
+static int
+returnTest3 (void)
+{
+ sighandler_t prev;
+
+ printf ("\n===== TEST 3 =====\n");
+
+ printf ("About to use sigset() to set SIG_HOLD\n");
+ prev = sigset (TEST_SIG, SIG_HOLD);
+ if (prev == SIG_ERR)
+ error (1, errno, "sigset");
+
+ printf ("About to use sigset() to set SIG_HOLD (again)\n");
+ prev = sigset (TEST_SIG, SIG_HOLD);
+ if (prev == SIG_ERR)
+ error (1, errno, "sigset");
+
+ printf ("Previous disposition: ");
+ printDisposition (prev);
+ printf (" (should be SIG_HOLD)\n");
+ if (prev != SIG_HOLD)
+ {
+ printf("TEST FAILED!!!\n");
+ return 1;
+ }
+ return 0;
+} /* returnTest3 */
+
+int
+main (int argc, char *argv[])
+{
+ pid_t childPid;
+
+ childPid = fork();
+ if (childPid == -1)
+ error (1, errno, "fork");
+
+ if (childPid == 0)
+ exit (returnTest1 ());
+
+ int status;
+ if (TEMP_FAILURE_RETRY (waitpid (childPid, &status, 0)) != childPid)
+ error (1, errno, "waitpid");
+ int result = !WIFEXITED (status) || WEXITSTATUS (status) != 0;
+
+ childPid = fork();
+ if (childPid == -1)
+ error (1, errno, "fork");
+
+ if (childPid == 0)
+ exit (returnTest2 ());
+
+ if (TEMP_FAILURE_RETRY (waitpid (childPid, &status, 0)) != childPid)
+ error (1, errno, "waitpid");
+ result |= !WIFEXITED (status) || WEXITSTATUS (status) != 0;
+
+ childPid = fork();
+ if (childPid == -1)
+ error (1, errno, "fork");
+
+ if (childPid == 0)
+ exit (returnTest3 ());
+
+ if (TEMP_FAILURE_RETRY (waitpid (childPid, &status, 0)) != childPid)
+ error (1, errno, "waitpid");
+ result |= !WIFEXITED (status) || WEXITSTATUS (status) != 0;
+
+ return result;
+} /* main */
diff --git a/ap/libc/glibc/glibc-2.22/signal/tst-sigsimple.c b/ap/libc/glibc/glibc-2.22/signal/tst-sigsimple.c
new file mode 100644
index 0000000..a1faff6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/signal/tst-sigsimple.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+ 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 <stdio.h>
+#include <string.h>
+
+
+static int
+do_test (void)
+{
+ int result = 0;
+ int e;
+
+#define RUN(test) \
+ errno = 0; \
+ e = test; \
+ if (e != -1) \
+ { \
+ printf ("%s returned %d\n", #test, e); \
+ result = 1; \
+ } \
+ else if (errno != EINVAL) \
+ { \
+ printf ("%s didn't set errno to EINVAL (%s instead)\n", \
+ #test, strerror (errno)); \
+ result = 1; \
+ }
+
+ RUN (sighold (-1));
+ RUN (sighold (_NSIG + 100));
+
+ RUN (sigrelse (-1));
+ RUN (sigrelse (_NSIG + 100));
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"