rust-random / getrandom

A small cross-platform library for retrieving random data from (operating) system source
Apache License 2.0
264 stars 166 forks source link

Add rustix backend #470

Closed notgull closed 2 weeks ago

notgull commented 3 weeks ago

This commit adds a backend based on the rustix crate. The main advantage of rustix, in addition to greater safety, is that it uses raw syscalls instead of going through libc.

I've tried to modify the existing libc code as little as possible, in order to make this change as auditable as possible. I haven't touched the pthreads code yet, as that's a little tricky.

This exists for discussion purposes.

cc #401

newpavlov commented 2 weeks ago

This PR is outdated, so I will close it. We probably will revisit the rustix question while adding support for none Linux targets.