{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/112","repository_url":"https://api.github.com/repos/rust-lang-nursery/rand","labels_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/112/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/112/events","html_url":"https://github.com/rust-lang-nursery/rand/pull/112","id":169296836,"number":112,"title":"Use arc4rand(9) on FreeBSD","user":{"login":"habnabit","id":21168,"avatar_url":"https://avatars.githubusercontent.com/u/21168?v=3","gravatar_id":"","url":"https://api.github.com/users/habnabit","html_url":"https://github.com/habnabit","followers_url":"https://api.github.com/users/habnabit/followers","following_url":"https://api.github.com/users/habnabit/following{/other_user}","gists_url":"https://api.github.com/users/habnabit/gists{/gist_id}","starred_url":"https://api.github.com/users/habnabit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habnabit/subscriptions","organizations_url":"https://api.github.com/users/habnabit/orgs","repos_url":"https://api.github.com/users/habnabit/repos","events_url":"https://api.github.com/users/habnabit/events{/privacy}","received_events_url":"https://api.github.com/users/habnabit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-04T05:54:22Z","updated_at":"2016-08-22T18:20:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/pulls/112","html_url":"https://github.com/rust-lang-nursery/rand/pull/112","diff_url":"https://github.com/rust-lang-nursery/rand/pull/112.diff","patch_url":"https://github.com/rust-lang-nursery/rand/pull/112.patch"},"body":"After reading through rust-lang/rust#30691 it seems that there's general agreement that using OS-provided facilities for seeding rust userland processes is fine as long as it doesn't use too much from libc. FreeBSD's `arc4random_buf(3)` is not only a whole lot of libc code, but also not even currently exposed in the libc crate. Fortunately, the mechanism `arc4random_buf(3)` et al. use for getting entropy from the kernel ([`arc4rand(9)`](https://www.freebsd.org/cgi/man.cgi?query=arc4random&apropos=0&sektion=9&manpath=FreeBSD+10.3-RELEASE&arch=default&format=html)) is exposed via `sysctl(3)` with constants that are already in the libc crate.\r\n\r\nI haven't found too much documentation on `KERN_ARND`—it's missing or only briefly described in most of the places that cover sysctl mibs. But, from digging through the kernel source, it appears that the sysctl used in this PR is very close to just calling `arc4rand(9)` directly (with `reseed` set to 0 and no way to change it)."},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/comments/241502966","html_url":"https://github.com/rust-lang-nursery/rand/pull/112#issuecomment-241502966","issue_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/112","id":241502966,"user":{"login":"brson","id":147214,"avatar_url":"https://avatars.githubusercontent.com/u/147214?v=3","gravatar_id":"","url":"https://api.github.com/users/brson","html_url":"https://github.com/brson","followers_url":"https://api.github.com/users/brson/followers","following_url":"https://api.github.com/users/brson/following{/other_user}","gists_url":"https://api.github.com/users/brson/gists{/gist_id}","starred_url":"https://api.github.com/users/brson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brson/subscriptions","organizations_url":"https://api.github.com/users/brson/orgs","repos_url":"https://api.github.com/users/brson/repos","events_url":"https://api.github.com/users/brson/events{/privacy}","received_events_url":"https://api.github.com/users/brson/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T18:20:48Z","updated_at":"2016-08-22T18:20:48Z","body":"cc @alexcrichton @brson"}}
{"actor":{"display_login":"brson"}}