Reads on `tokio::fs::File` are expected to block, and are performed
inside a `spawn_blocking` call so that they don't block the reactor.
Bug: 268075535
Test: read from /dev/socket/prng_seeder 256 times
Change-Id: I009d1fb11b540412e705cc2be0ebc7e2f09d2c0c
It is started very early before linker namespaces are configured, thus
making it a bootstrap process. Also, it is built with `prefer_rlib:
true` so that we don't spend time for dynamically linking the dylibs.
Bug: 263398430
Test: watch boottime benchmark
Change-Id: I5193d0d36958de5b6d6dfa8584212f82edb727bc
Without this init will repeatedly try to start this daemon,
causing logspam.
Also:
* wait until just before tokio conversion to set O_NONBLOCK
* ensure logging code reflects source example
* log at info and higher
* use contexts for better logging
* fall back to println to work around logging problems
* remove wrong copy-pasted comment in Android.bp
Bug: 249531229
Fixes: 249566340
Test: in permissive mode, rm /dev/hw_random before start
Change-Id: Ib70cbcb048f33dca789151622d98c6d56270fa37
This binary seeds a FIPS-approved DRBG from /dev/hw_random and then
serves seeds to other processes on the system using a socket
(/dev/socket/prng_seeder) that is passed in by init.
Bug: 243933553
Test: Started under init and verified correct operation using strace
Change-Id: Id4461a402d1ac92180a54cc4b241a2720b94d8de