From 7cdc7259c1b514197fee5a0d973f95fdf3347677 Mon Sep 17 00:00:00 2001 From: tgoodwin Date: Tue, 17 Feb 1998 13:48:31 +0000 Subject: split some restartable syscall stuff out don't declare slowbuf unless it's needed --- jbwrap.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'jbwrap.h') diff --git a/jbwrap.h b/jbwrap.h index 4074a32..e8a0790 100644 --- a/jbwrap.h +++ b/jbwrap.h @@ -1,9 +1,31 @@ #include -/* certain braindamaged environments don't define jmp_buf as an array, so... */ +/* If we have POSIX sigjmp_buf and friends, use them. If we don't, just +use a jmp_buf. This probably fails on a traditional SysV machine, where +jmp_bufs don't preserve signal masks. I'm not worrying about this till +someone reports it as a bug :-). */ + +#if HAVE_SIGSETJMP +#else +#define sigjmp_buf jmp_buf +#define sigsetjmp(x,y) setjmp(x) +#define siglongjmp longjmp +#endif /* HAVE_SIGSETJMP */ + + +/* Certain braindamaged environments don't define jmp_buf as an array, +so wrap it in a structure. Potentially, we could use configure to do +this only where it needs to be done, but the effort is probably not +worth it. */ struct Jbwrap { sigjmp_buf j; }; -extern Jbwrap slowbuf; /* for getting out of interrupts while performing slow i/o on BSD */ + +/* The slowbuf jump buffer is used to prevent "slow" system calls being +restarted on systems like BSD where they are restarted after a signal. */ + +#if HAVE_RESTARTABLE_SYSCALLS +extern Jbwrap slowbuf; +#endif -- cgit v1.2.3