pipe_exec icon indicating copy to clipboard operation
pipe_exec copied to clipboard

Port to OS X and Freebsd

Open koraa opened this issue 6 years ago • 0 comments

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…

koraa avatar Jul 04 '19 08:07 koraa