aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Unix/Program.inc
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r--llvm/lib/Support/Unix/Program.inc10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
index 897e227..9466d0f 100644
--- a/llvm/lib/Support/Unix/Program.inc
+++ b/llvm/lib/Support/Unix/Program.inc
@@ -340,10 +340,10 @@ static bool Execute(ProcessInfo &PI, StringRef Program,
namespace llvm {
namespace sys {
-#ifndef _AIX
-using ::wait4;
-#else
+#if defined(_AIX)
static pid_t(wait4)(pid_t pid, int *status, int options, struct rusage *usage);
+#elif !defined(__Fuchsia__)
+using ::wait4;
#endif
} // namespace sys
@@ -414,6 +414,7 @@ ProcessInfo llvm::sys::Wait(const ProcessInfo &PI,
// Parent process: Wait for the child process to terminate.
int status = 0;
ProcessInfo WaitResult;
+#ifndef __Fuchsia__
rusage Info;
if (ProcStat)
ProcStat->reset();
@@ -421,6 +422,7 @@ ProcessInfo llvm::sys::Wait(const ProcessInfo &PI,
do {
WaitResult.Pid = sys::wait4(ChildPid, &status, WaitPidOptions, &Info);
} while (WaitUntilTerminates && WaitResult.Pid == -1 && errno == EINTR);
+#endif
if (WaitResult.Pid != PI.Pid) {
if (WaitResult.Pid == 0) {
@@ -459,6 +461,7 @@ ProcessInfo llvm::sys::Wait(const ProcessInfo &PI,
sigaction(SIGALRM, &Old, nullptr);
}
+#ifndef __Fuchsia__
if (ProcStat) {
std::chrono::microseconds UserT = toDuration(Info.ru_utime);
std::chrono::microseconds KernelT = toDuration(Info.ru_stime);
@@ -468,6 +471,7 @@ ProcessInfo llvm::sys::Wait(const ProcessInfo &PI,
#endif
*ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory};
}
+#endif
// Return the proper exit status. Detect error conditions
// so we can return -1 for them and set ErrMsg informatively.