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 #ifndef SKIP_ATTRIBUTE
15 #define DESC_structmax "maximum useful struct alignment"
16 struct epoll_event_structmax
{
18 unsigned long long data
;
19 } __attribute__ ((aligned
));
22 #define DESC_struct4 "4-byte struct alignment"
23 struct epoll_event_struct4
{
25 unsigned long long data
;
26 } __attribute__ ((aligned(4)));
28 #define DESC_struct8 "8-byte struct alignment"
29 struct epoll_event_struct8
{
31 unsigned long long data
;
32 } __attribute__ ((aligned(8)));
34 #define DESC_data4 "4-byte alignment for data"
35 struct epoll_event_data4
{
37 unsigned long long data
__attribute__ ((aligned(4)));
40 #define DESC_data8 "8-byte alignment for data"
41 struct epoll_event_data8
{
43 unsigned long long data
__attribute__ ((aligned(8)));
46 #define DESC_p "packed attribute"
47 struct epoll_event_p
{
49 unsigned long long data
;
50 } __attribute__ ((packed
));
52 #define DESC_pstruct4 "packed attribute, 4-byte struct alignment"
53 struct epoll_event_pstruct4
{
55 unsigned long long data
;
56 } __attribute__ ((packed
)) __attribute__ ((aligned(4)));
58 #define DESC_pstruct8 "packed attribute, 8-byte struct alignment"
59 struct epoll_event_pstruct8
{
61 unsigned long long data
;
62 } __attribute__ ((packed
)) __attribute__ ((aligned(8)));
64 #define DESC_pdata4 "packed attribute, 4-byte alignment for data"
65 struct epoll_event_pdata4
{
67 unsigned long long data
__attribute__ ((aligned(4)));
68 } __attribute__ ((packed
));
70 #define DESC_pdata8 "packed attribute, 8-byte alignment for data"
71 struct epoll_event_pdata8
{
73 unsigned long long data
__attribute__ ((aligned(8)));
74 } __attribute__ ((packed
));