Crates from Github

I'm using Debian and i need a linux/kernel/uaccess.h package to write my code.
Is there an equivalent crate in Rust ?

Thank you

If you mean include/uacces.h in the linux source tree, that header doesn't make any sense outside of kernel code. It is for copying data between userspace and the kernel. This is not something userspace code can do. What are you trying to do?

1 Like

There doesn't seem to be any crate for it. You could try using bindgen to use this header in Rust.

I need it to evaluate my stuck-at errors in RAM via Braham test.
Especially i need "copy to user" function.

Are you writing a kernel module? If not, there is no way for you to copy data between userspace and kernel space. Linux doesn't offer any such option for security reasons. (technically there is /dev/ram that allows writing to arbitrary parts of the ram, but it needs root and is disabled on most modern distros. It was necessary for the X server in the past, but now that gpu drivers have moved into the kernel, this is no longer the case.)

In my case I use the path /dev/ram . It is for the purpose of thesis. i have a virtual machine with debian where i have root policies.

If you have access to /dev/ram you can use regular read and write syscalls to copy data between your own address space and whatever physical location in memory you want (including those used by the kernel itself) AFAIK.