[PATCHv3,29/30] signal/x86-32: use packed for compat rt_sigaction

Submitted by Dmitry Safonov on June 28, 2016, 7:24 p.m.

Details

Message ID 20160628192423.14943-30-dsafonov@virtuozzo.com
State Rejected
Series "x86 Compatible C/R, part 2"
Headers show

Commit Message

Dmitry Safonov June 28, 2016, 7:24 p.m.
Otherwise compiler nicely align it for us on 24 bytes.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
---
 criu/arch/x86/include/asm/types.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/arch/x86/include/asm/types.h b/criu/arch/x86/include/asm/types.h
index bb9d3a0c6119..a24d7b815506 100644
--- a/criu/arch/x86/include/asm/types.h
+++ b/criu/arch/x86/include/asm/types.h
@@ -48,7 +48,12 @@  typedef struct {
 	k_rtsigset_t	rt_sa_mask;
 } rt_sigaction_t;
 
-typedef struct {
+/*
+ * Note: there is unaligned access on x86_64 and it's fine.
+ * However, when porting this code -- keep in mind about possible issues
+ * with unaligned rt_sa_mask.
+ */
+typedef struct __attribute__((packed)) {
 	u32	rt_sa_handler;
 	u32	rt_sa_flags;
 	u32	rt_sa_restorer;