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.
This commit is contained in:
Jeff Johnston 2002-04-08 20:33:46 +00:00
parent 175c5e4c4d
commit c5ef1e95be
5 changed files with 72 additions and 7 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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)

View File

@ -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_ */

View File

@ -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);
}