Closed briansmith closed 2 weeks ago
What about the following comment about KERN_ARND
?
NetBSD will only return up to 256 bytes at a time, and older NetBSD kernels will fail on longer buffers.
Is it no longer relevant? To be safe it may be worth to use let buflen = min(buflen, 256)
in the polyfill function.
What about the following comment about
KERN_ARND
?NetBSD will only return up to 256 bytes at a time, and older NetBSD kernels will fail on longer buffers.
Is it no longer relevant? To be safe it may be worth to use
let buflen = min(buflen, 256)
in the polyfill function.
Thanks. As I mentioned in the other comment, I did make this change.
Remove LazyPtr. Avoid constructing an invalid pointer as a sentinel to indicate that the pointer is uninitialized. Now, a null pointer means it is uninitialized, and a non-null pointer means it is initialized. This is less questionable from a safety perspective, and should also be more efficient.
Reduce duplication between the "getrandom is available" and the fallback case.