Skip to content

sizeof(event) not always equal to 12 #41

@wegank

Description

@wegank

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions