Open Osiris-Team opened 2 years ago
You are probably looking for https://man7.org/linux/man-pages/man3/posix_spawn.3.html
, but why I repost my question: Why not use the JDK? Sure for 7+8 you need to use reflection, but then, you also don't need to know the ugly details of correctly spawning a new process and from 9 on you can access the PID directly and poke the process with posix/win32 APIs.
Thanks for the link, but that method is only available for linux (and its distros) and not all Unix systems, I think. Yeah, I could use the reflection API, but I think that's kind of nasty, and it's also blocked/not allowed on third-party applications sometimes. I am working on this: https://github.com/Osiris-Team/jProcesses2 and thus I'm gonna have to create processes manually.
The jna platform jar doesn't seem to include methods for creating processes on unix systems, but it does for windows here. It would be great to have something similar to that also for unix. I am a complete noob with native libraries, but I still would like to create a PR for this, so any additional information is very welcome! It looks like there is a
fork()
command on unix systems to achieve this.