Hi,
Agreed that it is ideal to have user config wrt FORCE_SIMPLECOUNTERMODE.
You do raise a important point wrt srandom, ie if developer is already using the c random
prng for some predictable sequencing of their own logic. But then the issue remains
independent of srandom, ie even use of just random at our end will mess with the programs
predictable sequence, unless they are using srandom_r and random_r. So better to use
srandom_r and random_r with its own context wrt the dns lookup logic, so that we dont step
on any other users of the global prng by a application.
dnsrand_setup gets called only once, bcas of the way dns_lookup uses its already existing
static variables and the flow around it.
Given that embedded systems could may or maynot have urandom as well as realtime clock
(and or might have been disabled), so I have tried to rig up a flow which potentially
works across multiple possible configurations by default. But otherwise another developer
had responded to my patch by mentioning about musl using clock_gettime, but then such a
flow would restrict things to only those builds which have realtime clock enabled.
Can understand the desire to maintain coding styles, being new to uclibc in recent times
and also given that my 1st goal was to try and put some ideas around possible paths and or
a patch, for anyone who may want one fast, coding style wasnt in my sight. However I will
keep the two points which you have mentioned in my sight for the patch I will put out
tomorrow.