# std: better definition for std.os.linux.epoll_event · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/314ce5465dfdc9f4d1e2d178704b47666d541fc4)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 314ce5465dfdc9f4d1e2d178704b47666d541fc4

Requested commit: 314ce5465dfdc9f4d1e2d178704b47666d541fc4

Commit: 314ce5465dfdc9f4d1e2d178704b47666d541fc4

Tree: 6b2d299575d87f405170c74b44fb99e279254a99

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std: better definition for std.os.linux.epoll_event

The previous definition depends on a non-lang-spec-compliant memory
layout for packed structs, which happens to trigger #11989 in stage2.

This commit changes the struct to be an extern struct with an
align(4) field. However, stage1 cannot handle this, so conditional
compilation logic is used to select different struct definitions
depending on stage1 vs stage2.

This works around #11989 but does not solve the underlying problem -
putting an extern union inside a packed struct will still trigger the
assert.

After this, both stage1 and stage2 std lib tests run assertion-clean
with a debug LLVM 13.

```

## Parents

- [5735ce39ae5a9fb2bc2ac9f5a722276c291b28bc](https://git.cafe/gitcafe/zig/commit/5735ce39ae5a9fb2bc2ac9f5a722276c291b28bc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/314ce5465dfdc9f4d1e2d178704b47666d541fc4?format=markdown)
