Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getentropy on Emscripten #307

Merged
merged 1 commit into from Oct 23, 2022
Merged

Use getentropy on Emscripten #307

merged 1 commit into from Oct 23, 2022

Conversation

josephlr
Copy link
Member

@josephlr josephlr commented Oct 23, 2022

Fixes #275, note that libc::getentropy isn't in the libc crate yet, so we have to manually declare the bindings.

The last version of the EMSDK that didn't have support for this was 2.0.4 released over two years ago, so I don't think we have to worry about users using a super old SDK version, especially considering this is an less-used target.

Signed-off-by: Joe Richey joerichey@google.com

@josephlr josephlr force-pushed the emscripten branch 4 times, most recently from e889c6d to 731ccc7 Compare October 23, 2022 05:58
@josephlr josephlr marked this pull request as ready for review October 23, 2022 06:06
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's worth to submit a patch which adds getentropy to libc? It looks like a small enough change for them to accept. But for now, I am fine with the manual declaration.

Signed-off-by: Joe Richey <joerichey@google.com>
@josephlr
Copy link
Member Author

Maybe it's worth to submit a patch which adds getentropy to libc? It looks like a small enough change for them to accept. But for now, I am fine with the manual declaration.

Sounds reasonable. I'm working on a few patches to send their way to make things easier on us w.r.t. declaring our own bindings.

@josephlr josephlr merged commit 710b24d into master Oct 23, 2022
@josephlr josephlr deleted the emscripten branch October 23, 2022 22:09
@newpavlov newpavlov mentioned this pull request Apr 2, 2023
@kleisauke
Copy link

FWIW, getentropy was added to libc for Emscripten via PR rust-lang/libc#3087.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use getentropy() libc function on Emscripten
3 participants