about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h')
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h b/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h
new file mode 100644
index 0000000000..6c85dbb6e8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h
@@ -0,0 +1,19 @@
+/* Architecture-specific adjustments to siginfo_t.  x86 version.  */
+#ifndef _BITS_SIGINFO_ARCH_H
+#define _BITS_SIGINFO_ARCH_H 1
+
+#if defined __x86_64__ && __WORDSIZE == 32
+/* si_utime and si_stime must be 4 byte aligned for x32 to match the
+   kernel.  We align siginfo_t to 8 bytes so that si_utime and
+   si_stime are actually aligned to 8 bytes since their offsets are
+   multiple of 8 bytes.  Note: with some compilers, the alignment
+   attribute would be ignored if it were put in __SI_CLOCK_T instead
+   of encapsulated in a typedef.  */
+typedef __clock_t __attribute__ ((__aligned__ (4))) __sigchld_clock_t;
+# undef  __SI_ALIGNMENT
+# define __SI_ALIGNMENT __attribute__ ((__aligned__ (8)))
+# undef  __SI_CLOCK_T
+# define __SI_CLOCK_T __sigchld_clock_t
+#endif
+
+#endif