Re: [PATCH v6 2/3] random: introduce generic vDSO getrandom() implementation

From: Jason A. Donenfeld
Date: Thu Nov 24 2022 - 06:57:50 EST


Hi Florian,

On Thu, Nov 24, 2022 at 06:28:44AM +0100, Florian Weimer wrote:
> > Right? And if you look at the expansion of that glibc macro, it's just:
> >
> > #define INTERNAL_SYSCALL_ERROR_P(val) \
> > ((unsigned long int) (val) > -4096UL)
> >
> > So it looks like the same exact thing?
>
> syscall already does internally (with a translation to -1, not NULL), so
> the caller shouldn't do it again. The userspace syscall function does
> *not* return an error code.

Ahh, okay. Thanks. I'll fix up the example to assume those semantics.

Jason