# Use /dev/urandom and sysctl\(RANDOM_UUID\) on Linux\. · gitcafe/zig

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

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

Visibility: public

Requested revision: 73ee434c8c81c373c8dc723c3aa6677978352642

Requested commit: 73ee434c8c81c373c8dc723c3aa6677978352642

Commit: 73ee434c8c81c373c8dc723c3aa6677978352642

Tree: 76c7319d14cc89645b4a1abb5539fa16c9abe8f6

Author: Ben Noordhuis

Committer: Ben Noordhuis

## Message

```
Use /dev/urandom and sysctl(RANDOM_UUID) on Linux.

Add fallback paths for when the getrandom(2) system call is not
available.  Try /dev/urandom first and sysctl(RANDOM_UUID) second.

The sysctl issues a warning in the system logs with some kernels but
that seems like an acceptable tradeoff for the fallback of a fallback.

```

## Parents

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

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