Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-04-09 00:33:46 +0400
committerJeff Johnston <jjohnstn@redhat.com>2002-04-09 00:33:46 +0400
commitc5ef1e95be66c5d1b456fa8518ca3902f9efd581 (patch)
tree4ef29d3868b2e45975955479c03a0b5db627d1f4 /newlib
parent175c5e4c4ddae8d6882ecd6932d40ff58fa915bd (diff)
2002-04-08 Jeff Johnston <jjohnstn@redhat.com>
* libc/sys/linux/include/setjmp.h: Add sigjmp_buf type, siglongjmp prototype, and sigsetjmp macro definition. * libc/sys/linux/siglongjmp.c: New file. * libc/sys/linux/Makefile.am: Add support for siglongjmp. * libc/sys/linux/Makefile.in: Regenerated.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog8
-rw-r--r--newlib/libc/sys/linux/Makefile.am3
-rw-r--r--newlib/libc/sys/linux/Makefile.in13
-rw-r--r--newlib/libc/sys/linux/include/setjmp.h39
-rw-r--r--newlib/libc/sys/linux/siglongjmp.c16
5 files changed, 72 insertions, 7 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 2ad6147f3..69123c84e 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,11 @@
+2002-04-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/sys/linux/include/setjmp.h: Add sigjmp_buf type,
+ siglongjmp prototype, and sigsetjmp macro definition.
+ * libc/sys/linux/siglongjmp.c: New file.
+ * libc/sys/linux/Makefile.am: Add support for siglongjmp.
+ * libc/sys/linux/Makefile.in: Regenerated.
+
2002-04-04 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Add support for installing crt1.o if one exists.
diff --git a/newlib/libc/sys/linux/Makefile.am b/newlib/libc/sys/linux/Makefile.am
index a3a0bbe89..aa020f0e2 100644
--- a/newlib/libc/sys/linux/Makefile.am
+++ b/newlib/libc/sys/linux/Makefile.am
@@ -9,7 +9,8 @@ SUBLIBS = $(LINUX_MACH_LIB)
LIB_SOURCES = \
brk.c getoptlong.c ids.c inode.c io.c linux.c process.c realpath.c \
- select.c signal.c socket.c sleep.c stack.c sysconf.c systat.c termios.c time.c \
+ select.c signal.c siglongjmp.c socket.c sleep.c stack.c \
+ sysconf.c systat.c termios.c time.c \
usleep.c wait.c
# This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1)
diff --git a/newlib/libc/sys/linux/Makefile.in b/newlib/libc/sys/linux/Makefile.in
index 56efb7cd2..22600b64b 100644
--- a/newlib/libc/sys/linux/Makefile.in
+++ b/newlib/libc/sys/linux/Makefile.in
@@ -94,7 +94,8 @@ SUBLIBS = $(LINUX_MACH_LIB)
LIB_SOURCES = \
brk.c getoptlong.c ids.c inode.c io.c linux.c process.c realpath.c \
- select.c signal.c socket.c sleep.c stack.c sysconf.c systat.c termios.c time.c \
+ select.c signal.c siglongjmp.c socket.c sleep.c stack.c \
+ sysconf.c systat.c termios.c time.c \
usleep.c wait.c
@@ -127,16 +128,16 @@ CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
@USE_LIBTOOL_FALSE@lib_a_OBJECTS = brk.o getoptlong.o ids.o inode.o \
@USE_LIBTOOL_FALSE@io.o linux.o process.o realpath.o select.o signal.o \
-@USE_LIBTOOL_FALSE@socket.o sleep.o stack.o sysconf.o systat.o \
-@USE_LIBTOOL_FALSE@termios.o time.o usleep.o wait.o
+@USE_LIBTOOL_FALSE@siglongjmp.o socket.o sleep.o stack.o sysconf.o \
+@USE_LIBTOOL_FALSE@systat.o termios.o time.o usleep.o wait.o
LTLIBRARIES = $(noinst_LTLIBRARIES)
@USE_LIBTOOL_TRUE@liblinux_la_DEPENDENCIES =
@USE_LIBTOOL_TRUE@liblinux_la_OBJECTS = brk.lo getoptlong.lo ids.lo \
@USE_LIBTOOL_TRUE@inode.lo io.lo linux.lo process.lo realpath.lo \
-@USE_LIBTOOL_TRUE@select.lo signal.lo socket.lo sleep.lo stack.lo \
-@USE_LIBTOOL_TRUE@sysconf.lo systat.lo termios.lo time.lo usleep.lo \
-@USE_LIBTOOL_TRUE@wait.lo
+@USE_LIBTOOL_TRUE@select.lo signal.lo siglongjmp.lo socket.lo sleep.lo \
+@USE_LIBTOOL_TRUE@stack.lo sysconf.lo systat.lo termios.lo time.lo \
+@USE_LIBTOOL_TRUE@usleep.lo wait.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
diff --git a/newlib/libc/sys/linux/include/setjmp.h b/newlib/libc/sys/linux/include/setjmp.h
new file mode 100644
index 000000000..04a9536ee
--- /dev/null
+++ b/newlib/libc/sys/linux/include/setjmp.h
@@ -0,0 +1,39 @@
+/*
+ setjmp.h
+ stubs for future use.
+*/
+
+#ifndef _SETJMP_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define _SETJMP_H_
+
+#include "_ansi.h"
+#include <machine/setjmp.h>
+#include <signal.h> /* for sigset_t and sigprocmask */
+
+typedef struct __sigjmpbuf
+{
+ jmp_buf __buf;
+ int __is_mask_saved;
+ sigset_t __saved_mask;
+} sigjmp_buf;
+
+void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval));
+int _EXFUN(setjmp,(jmp_buf __jmpb));
+void _EXFUN(siglongjmp,(sigjmp_buf __jmpb, int __retval));
+int _EXFUN(sigsetjmp,(sigjmp_buf __jmpb, int __savemask));
+
+/* sigsetjmp is implemented as macro using setjmp */
+
+#define sigsetjmp(__jmpb, __savemask) \
+ ( __jmpb.__is_mask_saved = __savemask && \
+ (sigprocmask (SIG_BLOCK, NULL, &__jmpb.__saved_mask) == 0), \
+ setjmp (__jmpb.__buf) )
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _SETJMP_H_ */
+
diff --git a/newlib/libc/sys/linux/siglongjmp.c b/newlib/libc/sys/linux/siglongjmp.c
new file mode 100644
index 000000000..075ed4421
--- /dev/null
+++ b/newlib/libc/sys/linux/siglongjmp.c
@@ -0,0 +1,16 @@
+/* libc/sys/linux/siglongjmp.c - siglongjmp function */
+
+/* Copyright 2002, Red Hat Inc. */
+
+
+#include <setjmp.h>
+#include <signal.h>
+
+void
+siglongjmp (sigjmp_buf env, int val)
+{
+ if (env.__is_mask_saved)
+ sigprocmask (SIG_SETMASK, &env.__saved_mask, NULL);
+
+ longjmp (env.__buf, val);
+}