rust
rust copied to clipboard
Add getentropy for RTEMS
RTEMS provides the getentropy function.
Use this for providing random data.
This PR enables the getentropy function for the RTEMS operating system to get random data.
It is exposed via libc (see https://github.com/rust-lang/libc/pull/3975).
r? @Noratrieb
rustbot has assigned @Noratrieb. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
Does RTEMS also have a suitable arc4random interface? If so, I'd prefer that, as we use that on nearly all other UNIXes.
Also I don't think the libc change has been released yet? That'll need to happen before this can be merged.
r? joboet
@joboet I checked and the arc4random function is also available. I updated the PR accordingly. This currently also does not require further changes to libc.
However, I might try to still move the function declaration there.
The changes in libc have been released tonight: https://github.com/rust-lang/libc/releases/tag/0.2.160
@joboet My suggestion would be to merge this PR with arc4random_buf defined here in std. I will add the definition to libc, so that it will become part of 0.2.161 and change it here afterwards. Alternatively, we can go back to the getentropy version and move to arc4random with the next libc release. Any preferences?
My goal is to get a first compiling version of the RTEMS tier 3 port into the mainline, so I can setup a local CI to track changes/regressions. Currently I have to manually monitor the different repos which is not ideal.
My suggestion would be to merge this PR with
arc4random_bufdefined here in std.
That seems reasonable. Could you also add RTEMS to the documentation for DefaultRandomSource? After that, I think this PR is ready to merge.
@joboet Thanks fixed.
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.
You can start a rebase with the following commands:
$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease
The following commits are merge commits:
- 339ae32d71a41b1542d9c1345a0f678f5511c20e
@bors r+ rollup
:pushpin: Commit e20636a78621d823334f3114d5d49ab8a442dfa3 has been approved by joboet
It is now in the queue for this repository.