File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ `getrandom()` backwards compatibility shim
2+
3+ To restore compatibility with older Linux platforms where `getrandom()` is
4+ unavailable either due to an outdated kernel or a legacy C library, Phobos now
5+ ships with a shim that emulates a limited subset of `getrandom()`’s behavior
6+ by reading random bytes from `/dev/urandom`.
7+
8+ To enable the shim, build DMD and Phobos with the environment variable
9+ `LINUX_LEGACY_EMULATE_GETRANDOM` set to `1`.
10+
11+ ```
12+ cd phobos
13+ LINUX_LEGACY_EMULATE_GETRANDOM=1 make
14+ ```
15+
16+ This functionality is a temporary fix and expected to be removed again soon
17+ by an upcoming release (approx. v2.112.0 or v2.113.0).
18+ The expected change is to replace the current “binding or shim” solution with
19+ a syscall wrapper and automatic `/dev/urandom` fallback.
Original file line number Diff line number Diff line change @@ -1782,7 +1782,6 @@ version (linux)
17821782
17831783 `getrandom()` was added to the GNU C Library in v2.25.
17841784 +/
1785- pragma (msg, " `getrandom()` emulation for legacy Linux targets is enabled." );
17861785
17871786 /+
17881787 On modern kernels (5.6+), `/dev/random` would behave more similar
You can’t perform that action at this time.
0 commit comments