pub fn push_at(&self, stack_top: usize) -> Stack {
        let mut writer = Stack::new(stack_top);
        // from stack_top:
        // program name
        writer.push_str(&self.args[0]);
        // environment strings
        let envs: Vec<_> = self
            .envs
            .iter()
            .map(|arg| {
                writer.push_str(arg.as_str());
                writer.sp
            })
            .collect();
        // argv strings
        let argv: Vec<_> = self
            .args
            .iter()
            .map(|arg| {
                writer.push_str(arg.as_str());
                writer.sp
            })
            .collect();
        // auxiliary vector entries
        writer.push_slice(&[null::<u8>(), null::<u8>()]);
        for (&type_, &value) in self.auxv.iter() {
            writer.push_slice(&[type_ as usize, value]);
        }
        // envionment pointers
        writer.push_slice(&[null::<u8>()]);
        writer.push_slice(envs.as_slice());
        // argv pointers
        writer.push_slice(&[null::<u8>()]);
        writer.push_slice(argv.as_slice());
        // argc
        writer.push_slice(&[argv.len()]);
        writer
    }
/// push process init information into stack
push process init information into stack
push process init information into stack
pub fn push_at(&self, stack_top: usize) -> Stack {
        let mut writer = Stack::new(stack_top);
        // from stack_top:
        // program name
        writer.push_str(&self.args[0]);
        // environment strings
        let envs: Vec<_> = self
            .envs
            .iter()
            .map(|arg| {
                writer.push_str(arg.as_str());
                writer.sp
            })
            .collect();
        // argv strings
        let argv: Vec<_> = self
            .args
            .iter()
            .map(|arg| {
                writer.push_str(arg.as_str());
                writer.sp
            })
            .collect();
        // auxiliary vector entries
        writer.push_slice(&[null::<u8>(), null::<u8>()]);
        for (&type_, &value) in self.auxv.iter() {
            writer.push_slice(&[type_ as usize, value]);
        }
        // envionment pointers
        writer.push_slice(&[null::<u8>()]);
        writer.push_slice(envs.as_slice());
        // argv pointers
        writer.push_slice(&[null::<u8>()]);
        writer.push_slice(argv.as_slice());
        // argc
        writer.push_slice(&[argv.len()]);
        writer
    }
pub fn push_at ( & self , stack_top : usize ) -> Stack { let mut writer = Stack :: new ( stack_top ) ; // from stack_top: // program name writer . push_str ( & self . args [ 0 ] ) ; // environment strings let envs : Vec < _ > = self . envs . iter ( ) . map ( | arg | { writer . push_str ( arg . as_str ( ) ) ; writer . sp } ) . collect ( ) ; // argv strings let argv : Vec < _ > = self . args . iter ( ) . map ( | arg | { writer . push_str ( arg . as_str ( ) ) ; writer . sp } ) . collect ( ) ; // auxiliary vector entries writer . push_slice ( & [ null :: < u8 > ( ) , null :: < u8 > ( ) ] ) ; for ( & type_ , & value ) in self . auxv . iter ( ) { writer . push_slice ( & [ type_ as usize , value ] ) ; } // envionment pointers writer . push_slice ( & [ null :: < u8 > ( ) ] ) ; writer . push_slice ( envs . as_slice ( ) ) ; // argv pointers writer . push_slice ( & [ null :: < u8 > ( ) ] ) ; writer . push_slice ( argv . as_slice ( ) ) ; // argc writer . push_slice ( & [ argv . len ( ) ] ) ; writer }
push process init information into stack
push process init information into stack
&self
stack_top
usize
&self
stack_top
usize