diff options
| author | tgoodwin <tgoodwin> | 1998-02-17 13:48:31 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:04 +0100 |
| commit | 7cdc7259c1b514197fee5a0d973f95fdf3347677 (patch) | |
| tree | 35d87b214d3617930e431f1d0aeee78c8298da5c /jbwrap.h | |
| parent | 2af5bbbb5355e9fcf311673f8051952c6b9b2509 (diff) | |
split some restartable syscall stuff out
don't declare slowbuf unless it's needed
Diffstat (limited to 'jbwrap.h')
| -rw-r--r-- | jbwrap.h | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -1,9 +1,31 @@ #include <setjmp.h> -/* 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 |