JFLib

plat/process_linux.rs (Linux)#

Source: lib/plat/process_linux.rs

Linux child pipes, exec and owned process groups. All allocations precede fork.
  • struct Child Native child with independent output pipes; drop terminates its process group.

impl Child

  • fn read_stdout(&mut self, bytes: &mut [u8]) -> Result<Option<usize>, u32> Read stdout without waiting; None means no data, Some(0) means EOF.
  • fn read_stderr(&mut self, bytes: &mut [u8]) -> Result<Option<usize>, u32> Read stderr without waiting; None means no data, Some(0) means EOF.
  • fn write_stdin(&mut self, bytes: &[u8]) -> Result<Option<usize>, u32> Write available bytes; retry None or the unwritten suffix.
  • fn id(&self) -> u32 The child's process id (as plat::process_alive takes it).
  • fn close_stdin(&mut self) Close stdin to request orderly helper shutdown.
  • fn try_wait(&mut self) -> Result<Option<i32>, u32> Poll exit status; signals map to 128 + signal.
  • fn terminate(&mut self) Terminate the owned process group and reap its leader.

Source: docs/API.md in the JFLib repository.