abort in srandomdev if kern.arandom sysctl fails
AcceptedPublic

Authored by emaste on Oct 3 2016, 1:44 PM.

Details

Reviewers
ed
jonathan
Summary

The sysctl cannot fail. If it does fail on some FreeBSD derivative or after some future change, just abort() so that the problem will be found and fixed.

While abort() is not normally suitable for a library, it makes sense here.

This is akin to D8077 for arc4random.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
emaste retitled this revision from to abort in srandomdev if kern.arandom sysctl fails.Oct 3 2016, 1:44 PM
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: jonathan, ed.
ed accepted this revision.Oct 3 2016, 4:50 PM
This revision is now accepted and ready to land.Oct 3 2016, 4:50 PM
jonathan accepted this revision.Oct 12 2016, 1:27 AM

Looks like a good idea to me. Perhaps it's worthy of a comment explaining why we use abort() within a library? It could contain the same text as at the top of this review, but it might be a slightly surprising thing to discover if you haven't been party to the review.