os.notify: fix struct epoll_event alignment#25779
Conversation
|
@kbkpbot this essentially reverts 6fcab01 2022-09-29, which solved the following problem with tcc: Note, how here, with tcc, the size of the same structure, is reported to be 16 with tcc, while it is 12 with everything else... |
|
I would like a solution, where the reported size is still the same with all compilers, so imho keep the custom .h file, and add some conditional logic there, to only do the packing for tcc/non arm? |
I found some bugs here.... checking.... |
|
I found the root cause of this bug, on my aarch64 box, has not define So it depend on the define of |
|
Can we just do something like this? : #if defined(__TINYC__) && defined(__V_amd64)
#pragma pack(push, 1)
#endif
#include <sys/epoll.h>
#if defined(__TINYC__) && defined(__V_amd64)
#pragma pack(pop)
#endif |
that is indeed unfortunate - we can not check that before including the header, and after that it is already too late, because the C compiler would have registered the struct definitions |
|
Ideally |
This should be a tcc bug, as I think tcc already support this feature long ago. |
This reverts commit ada97e1.
|
BTW, I checked RISC-V/Ubuntu, it did not define |
Original code force
struct epoll_eventsize = 12 under ARM64/Linux, this is not true, as it's size = 16.Fix issue #25778