Fuchsia doesn't provide wait4.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
What is implementing waitpid there? I'm not aware of any Fuchsia implementation of that API. The function in libc is an ENOSYS stub. If there were an emulation implementation of waitpid, there could as well be one for wait4 since some of the information analogous to struct rusage is accessible by other means on Fuchsia. But since there isn't AFAIK any waitpid et al that is actually useful on Fuchsia today, I'm a bit confused by this change. It seems like perhaps it's just getting something to compile and link that doesn't actually work. IMHO unless and until we provide a more full posix_spawn+wait* emulation library for Fuchsia--and perhaps even if we had one--the LLVM support should probably use the more direct Fuchsia mechanisms instead. For spawning subprocesses, that means fdio_spawn and then the direct Zircon syscall APIs to wait for process termination.
I'm aware that this implementation is not usable, right now the goal is just to make it compile to enable uses of other parts of LLVM that don't need this functionality (for example the DWARF parsing). I intend to replace all of this with native Fuchsia implementation in subsequent changes. For now I simplified this patch to avoid wait4 and waitpid altogether.
Fuchsia also doesn't actually provide wait or waitpid, so some more comments to that effect at least in the log would be useful. It also doesn't have signals, so the calls earlier in the function won't actually do anything.
It probably makes more sense to just define llvm::sys::Wait so that it always fails without any real implementation contents under #ifdef __Fuchsia__.
llvm/lib/Support/Unix/Program.inc | ||
---|---|---|
465 | Probably makes sense to set ProcStat->reset(); rather than not touching the output when we have no data. |
Probably makes sense to set ProcStat->reset(); rather than not touching the output when we have no data.