msys2.github.io icon indicating copy to clipboard operation
msys2.github.io copied to clipboard

Documentation request: porting fork+exec sequence to MinGW

Open ofry opened this issue 5 years ago • 3 comments

porting fork+exec sequence to MinGW, maybe at least one example how to replace it to smth.

I mean what should be written "instead of" fork+exec

ofry avatar Apr 27 '20 20:04 ofry

I want to achieve (for bmake porting):

  1. I want to exec bash command similar way as https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnvpe-wspawnvpe?view=vs-2019
  2. BUT: I need all output to stdout will go in pipe or buffer, as in https://docs.microsoft.com/en-us/previous-versions/96ayss4b(v%3Dvs.140) How I can achieve it? (why? I need to parse some bash commands output from *.mk files... something as uname, etc) _popen can't provide same environment :( and requires launching smth through cmd.exe

If I just want to exec bash command, _spawnvpe() works. But it just put all output in same stdout, nothing more.

ofry avatar May 12 '20 20:05 ofry

Are you familiar with another command that might already be ported to mingw that uses a similar fork+exec? You might be able to track down the ported code.

NetMage avatar May 12 '20 21:05 NetMage

@NetMage I think solution for such common problems should be described in wiki with example...

ofry avatar May 13 '20 05:05 ofry