1 /* Define several variants of struct epoll_event from the Linux kernel,
2 specifying various attributes that affect alignment and size.
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. */
8 #define DESC_orig "original"
9 struct epoll_event_orig
{
11 unsigned long long data
;
14 #define DESC_structmax "maximum useful struct alignment"
15 struct epoll_event_structmax
{
17 unsigned long long data
;
18 } __attribute__ ((aligned
));
21 #define DESC_struct4 "4-byte struct alignment"
22 struct epoll_event_struct4
{
24 unsigned long long data
;
25 } __attribute__ ((aligned(4)));
27 #define DESC_struct8 "8-byte struct alignment"
28 struct epoll_event_struct8
{
30 unsigned long long data
;
31 } __attribute__ ((aligned(8)));
33 #define DESC_data4 "4-byte alignment for data"
34 struct epoll_event_data4
{
36 unsigned long long data
__attribute__ ((aligned(4)));
39 #define DESC_data8 "8-byte alignment for data"
40 struct epoll_event_data8
{
42 unsigned long long data
__attribute__ ((aligned(8)));
45 #define DESC_p "packed attribute"
46 struct epoll_event_p
{
48 unsigned long long data
;
49 } __attribute__ ((packed
));
51 #define DESC_pstruct4 "packed attribute, 4-byte struct alignment"
52 struct epoll_event_pstruct4
{
54 unsigned long long data
;
55 } __attribute__ ((packed
)) __attribute__ ((aligned(4)));
57 #define DESC_pstruct8 "packed attribute, 8-byte struct alignment"
58 struct epoll_event_pstruct8
{
60 unsigned long long data
;
61 } __attribute__ ((packed
)) __attribute__ ((aligned(8)));
63 #define DESC_pdata4 "packed attribute, 4-byte alignment for data"
64 struct epoll_event_pdata4
{
66 unsigned long long data
__attribute__ ((aligned(4)));
67 } __attribute__ ((packed
));
69 #define DESC_pdata8 "packed attribute, 8-byte alignment for data"
70 struct epoll_event_pdata8
{
72 unsigned long long data
__attribute__ ((aligned(8)));
73 } __attribute__ ((packed
));