Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sizeof(event) not always equal to 12 #41

Open
wegank opened this issue Jul 19, 2022 · 1 comment
Open

sizeof(event) not always equal to 12 #41

wegank opened this issue Jul 19, 2022 · 1 comment

Comments

@wegank
Copy link

wegank commented Jul 19, 2022

By definition of epoll_event,

struct epoll_event {
uint32_t events;
epoll_data_t data;
}
#ifdef __x86_64__
__attribute__((__packed__))
#endif

the following test might fail on non-x86_64 platforms:

struct epoll_event event;
// this check works on 32bit _and_ 64bit, since
// sizeof(epoll_event) == sizeof(uint32_t) + sizeof(uint64_t)
ATF_REQUIRE(sizeof(event) == 12);

For example, on Linux / macOS on M1 (aarch64), the size should be 16.

@wegank
Copy link
Author

wegank commented Jul 27, 2022

Should be fixed by #34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant