getrandom should return the number of bytes successfully set on
success, not 0.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/test/src/sys/random/linux/getrandom_test.cpp | ||
---|---|---|
35 | I'm not sure why the mod operation is here, maybe add a comment explaining? |
libc/test/src/sys/random/linux/getrandom_test.cpp | ||
---|---|---|
35 |
Its just meant to be a compromise between not doing every single value and getting a decent spread. Could also be rand % 64 or something like that, but figured that might make test harder to reproduce. 64 should probably be a prime in retrospect. |
libc/test/src/sys/random/linux/getrandom_test.cpp | ||
---|---|---|
35 | Given that the range tested is only 8192 it's not a big deal to do the whole range. The pi estimation test below is performing 10,000,000 samples (with two calls each), and that's having a much greater effect on the runtime of this test. |
OK from my side but I have arrived late here. Please wait for @michaelrj who is leading this review.
I'm not sure why the mod operation is here, maybe add a comment explaining?