Use libc::SYS_futex_time64 on riscv32#698
Conversation
On RISC-V 32-bit (riscv32), the SYS_futex system call is often handled indirectly due to the use of a 64-bit time_t type. Specifically, while SYS_futex is not directly defined, a related syscall like SYS_futex_time64 can be used, Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
I don't think this patch is necessary. For RISC-V Linux or Android, we will never use this fallback backend ( Specifically on RISC-V, this crate will always use the Were you encountering a build issue with RISC-V? |
I am building for |
|
Do you encounter a compilation or a runtime error? The latter should not happen on a modern Linux kernel since the |
|
Closing this since we do not compile the |
I am getting build time failure on riscv32/musl/linux ( what you pointed to is for a glibc based system ) where SYS_futex might exist but musl does not do translations like glibc. |
Key is https://github.com/rust-random/getrandom/blob/03ec647de15d5c6c4e891261df7cd9ea5ca7d39d/src/backends.rs#L103C17-L103C37 Please reconsider this PR, it makes it portable across Linux, ( linux systems dont just use glibc, there are other C library runtimes e.g. musl, uclibc etc. which are supported ) and some distros e.g. apline is ( linux/musl ) use them |
I see. Then a better solution would be to add MUSL-based RV32/64 to the list of targets which use |
|
You also could ask |
This is intentional in musl, they only define what kernel exports. |
let me see in this direction |
posted a new PR - #699 |
On RISC-V 32-bit (riscv32), the SYS_futex system call is often handled indirectly due to the use of a 64-bit time_t type. Specifically, while SYS_futex is not directly defined, a related syscall like SYS_futex_time64 can be used,