-
Notifications
You must be signed in to change notification settings - Fork 349
Description
for historical reasons, many programs still invoke syscall()
directly instead of using the glibc wrapper around getrandom
(e.g. openssl does this).
If the build environment for faketime can guess at what such a syscall invocation would look like, maybe it could selectively intercept syscall
itself. If FAKERANDOM_SEED
is set, it could inspect the syscall number, and if it matches __NR_getrandom
then invoke the internal getrandom
instead. otherwise, it could forward the syscall through to real_syscall
.
I don't know whether any of this makes sense for platforms other than GNU/Linux, so i might initially limit any attempts to that platform.
There is some weird variadic argument handling stuff that i'm not sure my C knowledge is deep enough handle.