I'm playing around with a new init system with #![no_std]
and extern crate rlibc
and making syscalls with asm, and currently trying to not allocate memory either. So the scope of possible tools I have is limited.
I need to call the execve syscall, and it requires a char** argv
, and a char **envp
. I can hack together c-style strings as arrays of bytes with zeros, but how can I null-terminate a statically declared list of such (the last pointer being NULL)?
*const u8
instead ofint
. Theas_ptr()
method already returns a*const u8
, so you can just remove thetransmute
. To get a null pointer, useptr::null()
(or0 as *const T
) instead of0
. – Civvies