sunfishcode / mustang

Rust programs written entirely in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support `std::process`

sunfishcode opened this issue · comments

Support std::process, including Command.

  • Determine which system calls are needed. A first step might be to try to run tests/examples.rs under a mustang target, or Rust's process tests, and see what unimplemented functions are called.
  • Add the system calls to rustix.
  • Replace the unimplemented! code in c-scape with calls to rsix
  • For fork, we'll need to implement __register_atfork too, which will need something like a static OnceCell<Mutex<Vec<...>>> similar to DTORS in origin/src/programs.rs. It may make sense for this and fork itself to live in origin too, with c-scape providing just the C-ABI wrapper around it.
  • Add Rusts's process tests as tests/process.rs, with a comment at the top similar to tests/fs.rs.

If anyone's interested in working on any part of this, please leave a comment here! Or stop by Zulip. I'm happy to mentor, answer questions, explain what fork is, or, on the other hand, have an in-depth discussion about the relationship between fork, ambient authority, and operating system API design.