Skip to content

Port to OS X and Freebsd #2

@koraa

Description

@koraa

This will require feature testing to be done (see https://github.com/koraa/pipe_exec/tree/karo/feature-testing):

When fexecve & memfd_create is not available, we should:

  1. if stdin is a normal file, determine it's path and start using execve
  2. Otherwise use a temporary file in /tmp/ and if that fails try $HOME

When just memfd_create is missing we should:

  1. Try to execute the fd using fexecve
  2. Otherwise use a temporary file in /tmp/ and if that fails try $HOME

Using a temporary file should work like this:

  1. Create a temp file in /tmp/ using a random name
  2. Fill using transfer_mmap
  3. Make executable
  4. Fork a subprocess
  5. In main process, use execve
  6. In fork, wait for the main process to execve and then unlink the file

The signaling mechanism between main and fork needs to be determined…

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions