Re: [PATCH v6 2/3] random: introduce generic vDSO getrandom() implementation
From: Florian Weimer
Date: Wed Nov 23 2022 - 05:58:25 EST
* Jason A. Donenfeld:
> static void *vgetrandom_alloc(size_t *num, size_t *size_per_each, unsigned int flags)
> {
> unsigned long ret = syscall(__NR_vgetrandom_alloc, num, size_per_each, flags);
> return ret > -4096UL ? NULL : (void *)ret;
> }
The traditional syscall function returns -1 on error and set errors, so
using unsing long and the 4096 is quite misleading.
Thanks,
Florian