1 /* Define several variants of struct epoll_event from the Linux kernel, 2 specifying various attributes that affect alignment and size. 3 4 This test was developed for systems for which int is 32 bits and 5 long long is 64 bits; it might need to be disabled for systems where 6 either of those is not true. */ 7 8 #define DESC_orig "original" 9 struct epoll_event_orig { 10 unsigned int events; 11 unsigned long long data; 12 }; 13 14 #define DESC_structmax "maximum useful struct alignment" 15 struct epoll_event_structmax { 16 unsigned int events; 17 unsigned long long data; 18 } __attribute__ ((aligned)); 19 20 21 #define DESC_struct4 "4-byte struct alignment" 22 struct epoll_event_struct4 { 23 unsigned int events; 24 unsigned long long data; 25 } __attribute__ ((aligned(4))); 26 27 #define DESC_struct8 "8-byte struct alignment" 28 struct epoll_event_struct8 { 29 unsigned int events; 30 unsigned long long data; 31 } __attribute__ ((aligned(8))); 32 33 #define DESC_data4 "4-byte alignment for data" 34 struct epoll_event_data4 { 35 unsigned int events; 36 unsigned long long data __attribute__ ((aligned(4))); 37 }; 38 39 #define DESC_data8 "8-byte alignment for data" 40 struct epoll_event_data8 { 41 unsigned int events; 42 unsigned long long data __attribute__ ((aligned(8))); 43 }; 44 45 #define DESC_p "packed attribute" 46 struct epoll_event_p { 47 unsigned int events; 48 unsigned long long data; 49 } __attribute__ ((packed)); 50 51 #define DESC_pstruct4 "packed attribute, 4-byte struct alignment" 52 struct epoll_event_pstruct4 { 53 unsigned int events; 54 unsigned long long data; 55 } __attribute__ ((packed)) __attribute__ ((aligned(4))); 56 57 #define DESC_pstruct8 "packed attribute, 8-byte struct alignment" 58 struct epoll_event_pstruct8 { 59 unsigned int events; 60 unsigned long long data; 61 } __attribute__ ((packed)) __attribute__ ((aligned(8))); 62 63 #define DESC_pdata4 "packed attribute, 4-byte alignment for data" 64 struct epoll_event_pdata4 { 65 unsigned int events; 66 unsigned long long data __attribute__ ((aligned(4))); 67 } __attribute__ ((packed)); 68 69 #define DESC_pdata8 "packed attribute, 8-byte alignment for data" 70 struct epoll_event_pdata8 { 71 unsigned int events; 72 unsigned long long data __attribute__ ((aligned(8))); 73 } __attribute__ ((packed)); 74