Skip to main content

exec_trampoline

Function exec_trampoline 

Source
pub unsafe fn exec_trampoline(
    mail: i32,
    shim: *const c_char,
    argv: *const *const c_char,
    envp: *const *const c_char,
) -> !
Expand description

Execs the trampoline in the first tracee, through the allow gate, with the mailbox descriptor it inherited kept open for it. Allocation free, for use between fork and execve.

§Arguments

  • mail - The mailbox descriptor.
  • shim - Path of the trampoline from the kernel working directory.
  • argv - The command’s argument vector.
  • envp - Its environment.

§Safety

The pointers must be valid for execve. Exits the process, with 127 when the trampoline is missing and 126 for any other failure.