# dragonfly: add \`std.c.arc4random_buf\` · gitcafe/zig

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

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

Visibility: public

Requested revision: 69553d60daf1462079a8b5ff995014539c7ad32c

Requested commit: 69553d60daf1462079a8b5ff995014539c7ad32c

Commit: 69553d60daf1462079a8b5ff995014539c7ad32c

Tree: 77882cddae5b2d0d686ebbd6a415d6aaa0197cff

Author: Michael Dusan

Committer: Michael Dusan

## Message

```
dragonfly: add `std.c.arc4random_buf`

This allows for a more optimal std.crypto.tlcsprng codepath.

Without it a an "incorrect alignment" panic is triggered from
crypto.tlcsprng which aligns a threadlocal but it's actually
not aligned, thus detected by the safety check.

It appears that LLVM-IR does attribute the storage with alignment
but it is ultimately not respected in the final binary for netbsd
and dragonfly.

```

## Parents

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

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