1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

Kernel: Use word-sized entropy as much as possible in syscall

This commit is contained in:
Calvin Buckley 2019-10-13 12:55:58 -03:00 committed by Andreas Kling
parent aa42f56210
commit 5050f7b5ee
2 changed files with 19 additions and 9 deletions

View file

@ -511,9 +511,6 @@ unsigned long long strtoull(const char* str, char** endptr, int base)
uint32_t arc4random(void)
{
char buf[4];
// XXX: RandomDevice does return a uint32_t but the syscall works with
// a byte at a time. It could be better optimzied for this use case
// while remaining generic.
syscall(SC_getrandom, buf, 4, 0);
return *(uint32_t*)buf;
}