uClibc-sigaction2.patch 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. diff -Nur uClibc-0.9.32.1/libc/signal/Makefile.in uClibc.new/libc/signal/Makefile.in
  2. --- uClibc-0.9.32.1/libc/signal/Makefile.in 2011-12-30 12:11:07.000000000 +0100
  3. +++ uClibc.new/libc/signal/Makefile.in 2012-02-17 15:13:33.000000000 +0100
  4. @@ -17,7 +17,7 @@
  5. CSRC-$(UCLIBC_SUSV4_LEGACY) += sigintr.c
  6. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  7. -CSRC-y:=$(filter-out raise.c sigaction.c,$(CSRC-y))
  8. +CSRC-y:=$(filter-out raise.c,$(CSRC-y))
  9. endif
  10. ifneq ($(strip $(ARCH_OBJS)),)
  11. diff -Nur uClibc-0.9.32.1/libc/sysdeps/linux/arm/Makefile.arch uClibc.new/libc/sysdeps/linux/arm/Makefile.arch
  12. --- uClibc-0.9.32.1/libc/sysdeps/linux/arm/Makefile.arch 2011-12-30 12:11:07.000000000 +0100
  13. +++ uClibc.new/libc/sysdeps/linux/arm/Makefile.arch 2012-02-17 15:13:33.000000000 +0100
  14. @@ -5,11 +5,7 @@
  15. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  16. #
  17. -CSRC := brk.c ioperm.c iopl.c mmap.c __syscall_error.c
  18. -
  19. -ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  20. -CSRC += sigaction.c
  21. -endif
  22. +CSRC := brk.c ioperm.c iopl.c mmap.c __syscall_error.c sigaction.c
  23. SSRC := \
  24. __longjmp.S setjmp.S bsd-setjmp.S \
  25. diff -Nur uClibc-0.9.32.1/libc/sysdeps/linux/i386/Makefile.arch uClibc.new/libc/sysdeps/linux/i386/Makefile.arch
  26. --- uClibc-0.9.32.1/libc/sysdeps/linux/i386/Makefile.arch 2011-12-30 12:11:07.000000000 +0100
  27. +++ uClibc.new/libc/sysdeps/linux/i386/Makefile.arch 2012-02-17 15:13:33.000000000 +0100
  28. @@ -5,11 +5,7 @@
  29. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  30. #
  31. -CSRC := brk.c __syscall_error.c
  32. -
  33. -ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  34. -CSRC += sigaction.c
  35. -endif
  36. +CSRC := brk.c __syscall_error.c sigaction.c
  37. SSRC := \
  38. __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
  39. diff -Nur uClibc-0.9.32.1/libc/sysdeps/linux/mips/Makefile.arch uClibc.new/libc/sysdeps/linux/mips/Makefile.arch
  40. --- uClibc-0.9.32.1/libc/sysdeps/linux/mips/Makefile.arch 2011-12-30 12:11:07.000000000 +0100
  41. +++ uClibc.new/libc/sysdeps/linux/mips/Makefile.arch 2012-02-17 15:13:33.000000000 +0100
  42. @@ -7,7 +7,7 @@
  43. CSRC := \
  44. __longjmp.c brk.c setjmp_aux.c mmap.c \
  45. - cacheflush.c pread_write.c sysmips.c _test_and_set.c \
  46. + cacheflush.c pread_write.c sigaction.c sysmips.c _test_and_set.c \
  47. readahead.c
  48. SSRC := bsd-_setjmp.S bsd-setjmp.S setjmp.S syscall.S pipe.S syscall_error.S
  49. @@ -17,7 +17,6 @@
  50. endif
  51. ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  52. -CSRC += sigaction.c
  53. SSRC += vfork.S clone.S
  54. endif
  55. diff -Nur uClibc-0.9.32.1/libc/sysdeps/linux/sparc/Makefile.arch uClibc.new/libc/sysdeps/linux/sparc/Makefile.arch
  56. --- uClibc-0.9.32.1/libc/sysdeps/linux/sparc/Makefile.arch 2011-12-30 12:11:07.000000000 +0100
  57. +++ uClibc.new/libc/sysdeps/linux/sparc/Makefile.arch 2012-02-17 15:14:20.000000000 +0100
  58. @@ -5,15 +5,14 @@
  59. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  60. #
  61. -CSRC := brk.c __syscall_error.c
  62. +CSRC := brk.c __syscall_error.c sigaction.c
  63. SSRC := \
  64. __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
  65. syscall.S urem.S udiv.S umul.S sdiv.S rem.S pipe.S
  66. ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  67. -CSRC += sigaction.c
  68. -SSRC += fork.S vfork.S
  69. +SSRC += fork.S vfork.S clone.S
  70. endif
  71. # check weather __LONG_DOUBLE_128__ is defined (long double support)
  72. diff -Nur uClibc-0.9.32.1/libc/sysdeps/linux/x86_64/Makefile.arch uClibc.new/libc/sysdeps/linux/x86_64/Makefile.arch
  73. --- uClibc-0.9.32.1/libc/sysdeps/linux/x86_64/Makefile.arch 2011-12-30 12:11:07.000000000 +0100
  74. +++ uClibc.new/libc/sysdeps/linux/x86_64/Makefile.arch 2012-02-17 15:13:33.000000000 +0100
  75. @@ -5,11 +5,7 @@
  76. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  77. #
  78. -CSRC := brk.c __syscall_error.c mmap.c
  79. -
  80. -ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  81. -CSRC += sigaction.c
  82. -endif
  83. +CSRC := brk.c __syscall_error.c sigaction.c mmap.c
  84. SSRC := \
  85. __longjmp.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S
  86. diff -Nur uClibc-0.9.32.1/libpthread/nptl/.gitignore uClibc.new/libpthread/nptl/.gitignore
  87. --- uClibc-0.9.32.1/libpthread/nptl/.gitignore 2011-12-30 12:11:07.000000000 +0100
  88. +++ uClibc.new/libpthread/nptl/.gitignore 2012-02-17 15:13:33.000000000 +0100
  89. @@ -24,6 +24,5 @@
  90. #
  91. # symlinks
  92. #
  93. -sysdeps/pthread/pt-sigaction.c
  94. sysdeps/pthread/pt-sigfillset.c
  95. sysdeps/pthread/pt-sigprocmask.c
  96. diff -Nur uClibc-0.9.32.1/libpthread/nptl/sysdeps/pthread/Makefile.in uClibc.new/libpthread/nptl/sysdeps/pthread/Makefile.in
  97. --- uClibc-0.9.32.1/libpthread/nptl/sysdeps/pthread/Makefile.in 2011-12-30 12:11:07.000000000 +0100
  98. +++ uClibc.new/libpthread/nptl/sysdeps/pthread/Makefile.in 2012-02-17 15:13:33.000000000 +0100
  99. @@ -42,8 +42,6 @@
  100. CFLAGS-pthread_spin_destroy.c = -D_GNU_SOURCE
  101. CFLAGS-pthread_spin_init.c = -D_GNU_SOURCE
  102. CFLAGS-pthread_spin_unlock.c = -D_GNU_SOURCE
  103. -CFLAGS-pt-sigaction.c = -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) \
  104. - -I$(top_srcdir)libc/signal
  105. CFLAGS-pt-sigfillset.c = -I$(top_srcdir)libc/signal
  106. CFLAGS-pt-sigprocmask.c = -I$(top_srcdir)libc/sysdeps/linux/common
  107. CFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables
  108. @@ -58,10 +56,6 @@
  109. libpthread-so-y += $(patsubst %,$(libpthread_pthread_OUT)/%.oS, \
  110. pt-sigaction pt-sigprocmask unwind-forcedunwind)
  111. -CFLAGS-OMIT-sigaction.c = $(CFLAGS-pthread)
  112. -CFLAGS-sigaction.c = -I$(top_srcdir)libc/signal
  113. -libc-y += $(libpthread_pthread_OUT)/sigaction.o
  114. -
  115. librt-pt-routines-y = librt-cancellation.c
  116. librt-pt-shared-only-routines-y = rt-unwind-resume.c
  117. @@ -114,7 +108,7 @@
  118. # impl, but ok.
  119. # Special rules needed since we do objdir->objdir compilation for these 3.
  120. # First symlink them, then build them. Rob would freak out on these. Sheesh! ;)
  121. -pthread-lc-fwd = sigaction sigfillset sigprocmask
  122. +pthread-lc-fwd = sigfillset sigprocmask
  123. $(patsubst %,$(libpthread_pthread_OUT)/pt-%.c,$(pthread-lc-fwd)): | $(libpthread_pthread_OUT)
  124. $(do_ln) $(call rel_srcdir)$(patsubst pt-%,$(libpthread_pthread_DIR)/%,$(@F)) $@
  125. $(patsubst %,$(libpthread_pthread_OUT)/pt-%.oS,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.oS: $(libpthread_pthread_OUT)/pt-%.c
  126. @@ -131,5 +125,5 @@
  127. CLEAN_libpthread/nptl/sysdeps/pthread:
  128. $(do_rm) $(addprefix $(libpthread_pthread_OUT)/*., o os oS s S) \
  129. $(libpthread_pthread_OUT)/defs.h \
  130. - $(addprefix $(libpthread_pthread_DIR)/,pt-sigaction.c \
  131. + $(addprefix $(libpthread_pthread_DIR)/, \
  132. pt-sigfillset.c pt-sigprocmask.c)
  133. diff -Nur uClibc-0.9.32.1/libpthread/nptl/sysdeps/pthread/pt-sigaction.c uClibc.new/libpthread/nptl/sysdeps/pthread/pt-sigaction.c
  134. --- uClibc-0.9.32.1/libpthread/nptl/sysdeps/pthread/pt-sigaction.c 1970-01-01 01:00:00.000000000 +0100
  135. +++ uClibc.new/libpthread/nptl/sysdeps/pthread/pt-sigaction.c 2012-02-17 15:13:33.000000000 +0100
  136. @@ -0,0 +1,40 @@
  137. +/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
  138. + This file is part of the GNU C Library.
  139. + Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
  140. +
  141. + The GNU C Library is free software; you can redistribute it and/or
  142. + modify it under the terms of the GNU Lesser General Public
  143. + License as published by the Free Software Foundation; either
  144. + version 2.1 of the License, or (at your option) any later version.
  145. +
  146. + The GNU C Library is distributed in the hope that it will be useful,
  147. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  148. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  149. + Lesser General Public License for more details.
  150. +
  151. + You should have received a copy of the GNU Lesser General Public
  152. + License along with the GNU C Library; if not, write to the Free
  153. + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  154. + 02111-1307 USA. */
  155. +
  156. +#include <pthreadP.h>
  157. +#include <signal.h>
  158. +
  159. +/* We use the libc implementation but we tell it to not allow
  160. + SIGCANCEL or SIGTIMER to be handled. */
  161. +
  162. +extern __typeof(sigaction) __libc_sigaction;
  163. +int
  164. +__sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
  165. +{
  166. + if (unlikely (sig == SIGCANCEL || sig == SIGSETXID))
  167. + {
  168. + __set_errno (EINVAL);
  169. + return -1;
  170. + }
  171. +
  172. + return __libc_sigaction (sig, act, oact);
  173. +}
  174. +libc_hidden_proto(sigaction)
  175. +weak_alias (__sigaction, sigaction)
  176. +libc_hidden_weak(sigaction)
  177. diff -Nur uClibc-0.9.32.1/libpthread/nptl/sysdeps/pthread/sigaction.c uClibc.new/libpthread/nptl/sysdeps/pthread/sigaction.c
  178. --- uClibc-0.9.32.1/libpthread/nptl/sysdeps/pthread/sigaction.c 2011-12-30 12:11:07.000000000 +0100
  179. +++ uClibc.new/libpthread/nptl/sysdeps/pthread/sigaction.c 1970-01-01 01:00:00.000000000 +0100
  180. @@ -1,49 +0,0 @@
  181. -/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
  182. - This file is part of the GNU C Library.
  183. - Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
  184. -
  185. - The GNU C Library is free software; you can redistribute it and/or
  186. - modify it under the terms of the GNU Lesser General Public
  187. - License as published by the Free Software Foundation; either
  188. - version 2.1 of the License, or (at your option) any later version.
  189. -
  190. - The GNU C Library is distributed in the hope that it will be useful,
  191. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  192. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  193. - Lesser General Public License for more details.
  194. -
  195. - You should have received a copy of the GNU Lesser General Public
  196. - License along with the GNU C Library; if not, write to the Free
  197. - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  198. - 02111-1307 USA. */
  199. -
  200. -#ifndef LIBC_SIGACTION
  201. -
  202. -#include <pthreadP.h>
  203. -
  204. -/* We use the libc implementation but we tell it to not allow
  205. - SIGCANCEL or SIGTIMER to be handled. */
  206. -#define LIBC_SIGACTION 1
  207. -#include <sigaction.c>
  208. -
  209. -extern __typeof(sigaction) __sigaction;
  210. -int
  211. -__sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
  212. -{
  213. - if (__builtin_expect (sig == SIGCANCEL || sig == SIGSETXID, 0))
  214. - {
  215. - __set_errno (EINVAL);
  216. - return -1;
  217. - }
  218. -
  219. - return __libc_sigaction (sig, act, oact);
  220. -}
  221. -libc_hidden_proto(sigaction)
  222. -weak_alias (__sigaction, sigaction)
  223. -libc_hidden_weak(sigaction)
  224. -
  225. -#else
  226. -
  227. -# include_next <sigaction.c>
  228. -
  229. -#endif /* LIBC_SIGACTION */