about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-07-03 20:07:33 -0400
committerRich Felker <dalias@aerifal.cx>2012-07-03 20:07:33 -0400
commitd6c0efe106b1016108207fb6872820c06dcef4f8 (patch)
tree700300d0b4ff576121241befdcf865678cde4e5c /include
parente6129e6d836e5f4725d9b14ba7457b32e24adc61 (diff)
downloadmusl-d6c0efe106b1016108207fb6872820c06dcef4f8.tar.gz
musl-d6c0efe106b1016108207fb6872820c06dcef4f8.tar.xz
musl-d6c0efe106b1016108207fb6872820c06dcef4f8.zip
jmp_buf overhaul fixing several issues
on arm, the location of the saved-signal-mask flag and mask were off
by one between sigsetjmp and siglongjmp, causing incorrect behavior
restoring the signal mask. this is because the siglongjmp code assumed
an extra slot was in the non-sig jmp_buf for the flag, but arm did not
have this. now, the extra slot is removed for all archs since it was
useless.

also, arm eabi requires jmp_buf to have 8-byte alignment. we achieve
that using long long as the type rather than with non-portable gcc
attribute tags.
Diffstat (limited to 'include')
-rw-r--r--include/setjmp.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/setjmp.h b/include/setjmp.h
index 83ad7491..28ff92e4 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -11,7 +11,11 @@ extern "C" {
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  || defined(_BSD_SOURCE)
-typedef unsigned long sigjmp_buf[(128+sizeof(jmp_buf))/sizeof(long)];
+typedef struct {
+	jmp_buf __jb;
+	unsigned long __fl;
+	unsigned long __ss[128];
+} sigjmp_buf[1];
 int sigsetjmp (sigjmp_buf, int);
 void siglongjmp (sigjmp_buf, int);
 #endif