LLVM 20.0.0git
Program.inc
Go to the documentation of this file.
1//===- llvm/Support/Unix/Program.inc ----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the Unix specific portion of the Program class.
10//
11//===----------------------------------------------------------------------===//
12
13//===----------------------------------------------------------------------===//
14//=== WARNING: Implementation here must contain only generic UNIX
15//=== code that is guaranteed to work on *all* UNIX variants.
16//===----------------------------------------------------------------------===//
17
19
20#include "Unix.h"
22#include "llvm/Config/config.h"
25#include "llvm/Support/Errc.h"
27#include "llvm/Support/Path.h"
31#include <sys/stat.h>
32#if HAVE_SYS_RESOURCE_H
33#include <sys/resource.h>
34#endif
35#include <signal.h>
36#include <fcntl.h>
37#if HAVE_UNISTD_H
38#include <unistd.h>
39#endif
40#ifdef HAVE_POSIX_SPAWN
41#include <spawn.h>
42
43#if defined(__APPLE__)
44#include <TargetConditionals.h>
45#endif
46
47#if defined(__APPLE__) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
48#define USE_NSGETENVIRON 1
49#else
50#define USE_NSGETENVIRON 0
51#endif
52
53#if !USE_NSGETENVIRON
54extern char **environ;
55#else
56#include <crt_externs.h> // _NSGetEnviron
57#endif
58#endif
59
60using namespace llvm;
61using namespace sys;
62
63ProcessInfo::ProcessInfo() : Pid(0), ReturnCode(0) {}
64
65ErrorOr<std::string> sys::findProgramByName(StringRef Name,
66 ArrayRef<StringRef> Paths) {
67 assert(!Name.empty() && "Must have a name!");
68 // Use the given path verbatim if it contains any slashes; this matches
69 // the behavior of sh(1) and friends.
70 if (Name.contains('/'))
71 return std::string(Name);
72
73 SmallVector<StringRef, 16> EnvironmentPaths;
74 if (Paths.empty())
75 if (const char *PathEnv = std::getenv("PATH")) {
76 SplitString(PathEnv, EnvironmentPaths, ":");
77 Paths = EnvironmentPaths;
78 }
79
80 for (auto Path : Paths) {
81 if (Path.empty())
82 continue;
83
84 // Check to see if this first directory contains the executable...
85 SmallString<128> FilePath(Path);
86 sys::path::append(FilePath, Name);
87 if (sys::fs::can_execute(FilePath.c_str()))
88 return std::string(FilePath); // Found the executable!
89 }
90 return errc::no_such_file_or_directory;
91}
92
93static bool RedirectIO(std::optional<StringRef> Path, int FD, std::string *ErrMsg) {
94 if (!Path) // Noop
95 return false;
96 std::string File;
97 if (Path->empty())
98 // Redirect empty paths to /dev/null
99 File = "/dev/null";
100 else
101 File = std::string(*Path);
102
103 // Open the file
104 int InFD = open(File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY | O_CREAT, 0666);
105 if (InFD == -1) {
106 MakeErrMsg(ErrMsg, "Cannot open file '" + File + "' for " +
107 (FD == 0 ? "input" : "output"));
108 return true;
109 }
110
111 // Install it as the requested FD
112 if (dup2(InFD, FD) == -1) {
113 MakeErrMsg(ErrMsg, "Cannot dup2");
114 close(InFD);
115 return true;
116 }
117 close(InFD); // Close the original FD
118 return false;
119}
120
121#ifdef HAVE_POSIX_SPAWN
122static bool RedirectIO_PS(const std::string *Path, int FD, std::string *ErrMsg,
123 posix_spawn_file_actions_t *FileActions) {
124 if (!Path) // Noop
125 return false;
126 const char *File;
127 if (Path->empty())
128 // Redirect empty paths to /dev/null
129 File = "/dev/null";
130 else
131 File = Path->c_str();
132
133 if (int Err = posix_spawn_file_actions_addopen(
134 FileActions, FD, File, FD == 0 ? O_RDONLY : O_WRONLY | O_CREAT, 0666))
135 return MakeErrMsg(ErrMsg, "Cannot posix_spawn_file_actions_addopen", Err);
136 return false;
137}
138#endif
139
140static void TimeOutHandler(int Sig) {}
141
142static void SetMemoryLimits(unsigned size) {
143#if HAVE_SYS_RESOURCE_H && HAVE_GETRLIMIT && HAVE_SETRLIMIT
144 struct rlimit r;
145 __typeof__(r.rlim_cur) limit = (__typeof__(r.rlim_cur))(size)*1048576;
146
147 // Heap size
148 getrlimit(RLIMIT_DATA, &r);
149 r.rlim_cur = limit;
150 setrlimit(RLIMIT_DATA, &r);
151#ifdef RLIMIT_RSS
152 // Resident set size.
153 getrlimit(RLIMIT_RSS, &r);
154 r.rlim_cur = limit;
155 setrlimit(RLIMIT_RSS, &r);
156#endif
157#endif
158}
159
160static std::vector<const char *>
161toNullTerminatedCStringArray(ArrayRef<StringRef> Strings, StringSaver &Saver) {
162 std::vector<const char *> Result;
163 for (StringRef S : Strings)
164 Result.push_back(Saver.save(S).data());
165 Result.push_back(nullptr);
166 return Result;
167}
168
169static bool Execute(ProcessInfo &PI, StringRef Program,
171 std::optional<ArrayRef<StringRef>> Env,
172 ArrayRef<std::optional<StringRef>> Redirects,
173 unsigned MemoryLimit, std::string *ErrMsg,
174 BitVector *AffinityMask, bool DetachProcess) {
175 if (!llvm::sys::fs::exists(Program)) {
176 if (ErrMsg)
177 *ErrMsg = std::string("Executable \"") + Program.str() +
178 std::string("\" doesn't exist!");
179 return false;
180 }
181
182 assert(!AffinityMask && "Starting a process with an affinity mask is "
183 "currently not supported on Unix!");
184
186 StringSaver Saver(Allocator);
187 std::vector<const char *> ArgVector, EnvVector;
188 const char **Argv = nullptr;
189 const char **Envp = nullptr;
190 ArgVector = toNullTerminatedCStringArray(Args, Saver);
191 Argv = ArgVector.data();
192 if (Env) {
193 EnvVector = toNullTerminatedCStringArray(*Env, Saver);
194 Envp = EnvVector.data();
195 }
196
197 // If this OS has posix_spawn and there is no memory limit being implied, use
198 // posix_spawn. It is more efficient than fork/exec.
199#ifdef HAVE_POSIX_SPAWN
200 // Cannot use posix_spawn if you would like to detach the process
201 if (MemoryLimit == 0 && !DetachProcess) {
202 posix_spawn_file_actions_t FileActionsStore;
203 posix_spawn_file_actions_t *FileActions = nullptr;
204
205 // If we call posix_spawn_file_actions_addopen we have to make sure the
206 // c strings we pass to it stay alive until the call to posix_spawn,
207 // so we copy any StringRefs into this variable.
208 std::string RedirectsStorage[3];
209
210 if (!Redirects.empty()) {
211 assert(Redirects.size() == 3);
212 std::string *RedirectsStr[3] = {nullptr, nullptr, nullptr};
213 for (int I = 0; I < 3; ++I) {
214 if (Redirects[I]) {
215 RedirectsStorage[I] = std::string(*Redirects[I]);
216 RedirectsStr[I] = &RedirectsStorage[I];
217 }
218 }
219
220 FileActions = &FileActionsStore;
221 posix_spawn_file_actions_init(FileActions);
222
223 // Redirect stdin/stdout.
224 if (RedirectIO_PS(RedirectsStr[0], 0, ErrMsg, FileActions) ||
225 RedirectIO_PS(RedirectsStr[1], 1, ErrMsg, FileActions))
226 return false;
227 if (!Redirects[1] || !Redirects[2] || *Redirects[1] != *Redirects[2]) {
228 // Just redirect stderr
229 if (RedirectIO_PS(RedirectsStr[2], 2, ErrMsg, FileActions))
230 return false;
231 } else {
232 // If stdout and stderr should go to the same place, redirect stderr
233 // to the FD already open for stdout.
234 if (int Err = posix_spawn_file_actions_adddup2(FileActions, 1, 2))
235 return !MakeErrMsg(ErrMsg, "Can't redirect stderr to stdout", Err);
236 }
237 }
238
239 if (!Envp)
240#if !USE_NSGETENVIRON
241 Envp = const_cast<const char **>(environ);
242#else
243 // environ is missing in dylibs.
244 Envp = const_cast<const char **>(*_NSGetEnviron());
245#endif
246
247 constexpr int maxRetries = 8;
248 int retries = 0;
249 pid_t PID;
250 int Err;
251 do {
252 PID = 0; // Make Valgrind happy.
253 Err = posix_spawn(&PID, Program.str().c_str(), FileActions,
254 /*attrp*/ nullptr, const_cast<char **>(Argv),
255 const_cast<char **>(Envp));
256 } while (Err == EINTR && ++retries < maxRetries);
257
258 if (FileActions)
259 posix_spawn_file_actions_destroy(FileActions);
260
261 if (Err)
262 return !MakeErrMsg(ErrMsg, "posix_spawn failed", Err);
263
264 PI.Pid = PID;
265 PI.Process = PID;
266
267 return true;
268 }
269#endif // HAVE_POSIX_SPAWN
270
271 // Create a child process.
272 int child = fork();
273 switch (child) {
274 // An error occurred: Return to the caller.
275 case -1:
276 MakeErrMsg(ErrMsg, "Couldn't fork");
277 return false;
278
279 // Child process: Execute the program.
280 case 0: {
281 // Redirect file descriptors...
282 if (!Redirects.empty()) {
283 // Redirect stdin
284 if (RedirectIO(Redirects[0], 0, ErrMsg)) {
285 return false;
286 }
287 // Redirect stdout
288 if (RedirectIO(Redirects[1], 1, ErrMsg)) {
289 return false;
290 }
291 if (Redirects[1] && Redirects[2] && *Redirects[1] == *Redirects[2]) {
292 // If stdout and stderr should go to the same place, redirect stderr
293 // to the FD already open for stdout.
294 if (-1 == dup2(1, 2)) {
295 MakeErrMsg(ErrMsg, "Can't redirect stderr to stdout");
296 return false;
297 }
298 } else {
299 // Just redirect stderr
300 if (RedirectIO(Redirects[2], 2, ErrMsg)) {
301 return false;
302 }
303 }
304 }
305
306 if (DetachProcess) {
307 // Detach from controlling terminal
308 if (::setsid() == -1) {
309 MakeErrMsg(ErrMsg, "Could not detach process, ::setsid failed");
310 return false;
311 }
312 }
313
314 // Set memory limits
315 if (MemoryLimit != 0) {
316 SetMemoryLimits(MemoryLimit);
317 }
318
319 // Execute!
320 std::string PathStr = std::string(Program);
321 if (Envp != nullptr)
322 execve(PathStr.c_str(), const_cast<char **>(Argv),
323 const_cast<char **>(Envp));
324 else
325 execv(PathStr.c_str(), const_cast<char **>(Argv));
326 // If the execve() failed, we should exit. Follow Unix protocol and
327 // return 127 if the executable was not found, and 126 otherwise.
328 // Use _exit rather than exit so that atexit functions and static
329 // object destructors cloned from the parent process aren't
330 // redundantly run, and so that any data buffered in stdio buffers
331 // cloned from the parent aren't redundantly written out.
332 _exit(errno == ENOENT ? 127 : 126);
333 }
334
335 // Parent process: Break out of the switch to do our processing.
336 default:
337 break;
338 }
339
340 PI.Pid = child;
341 PI.Process = child;
342
343 return true;
344}
345
346namespace llvm {
347namespace sys {
348
349#if defined(_AIX)
350static pid_t(wait4)(pid_t pid, int *status, int options, struct rusage *usage);
351#elif !defined(__Fuchsia__)
352using ::wait4;
353#endif
354
355} // namespace sys
356} // namespace llvm
357
358#ifdef _AIX
359#ifndef _ALL_SOURCE
360extern "C" pid_t(wait4)(pid_t pid, int *status, int options,
361 struct rusage *usage);
362#endif
363pid_t(llvm::sys::wait4)(pid_t pid, int *status, int options,
364 struct rusage *usage) {
365 assert(pid > 0 && "Only expecting to handle actual PID values!");
366 assert((options & ~WNOHANG) == 0 && "Expecting WNOHANG at most!");
367 assert(usage && "Expecting usage collection!");
368
369 // AIX wait4 does not work well with WNOHANG.
370 if (!(options & WNOHANG))
371 return ::wait4(pid, status, options, usage);
372
373 // For WNOHANG, we use waitid (which supports WNOWAIT) until the child process
374 // has terminated.
375 siginfo_t WaitIdInfo;
376 WaitIdInfo.si_pid = 0;
377 int WaitIdRetVal =
378 waitid(P_PID, pid, &WaitIdInfo, WNOWAIT | WEXITED | options);
379
380 if (WaitIdRetVal == -1 || WaitIdInfo.si_pid == 0)
381 return WaitIdRetVal;
382
383 assert(WaitIdInfo.si_pid == pid);
384
385 // The child has already terminated, so a blocking wait on it is okay in the
386 // absence of indiscriminate `wait` calls from the current process (which
387 // would cause the call here to fail with ECHILD).
388 return ::wait4(pid, status, options & ~WNOHANG, usage);
389}
390#endif
391
393 std::optional<unsigned> SecondsToWait,
394 std::string *ErrMsg,
395 std::optional<ProcessStatistics> *ProcStat,
396 bool Polling) {
397 struct sigaction Act, Old;
398 assert(PI.Pid && "invalid pid to wait on, process not started?");
399
400 int WaitPidOptions = 0;
401 pid_t ChildPid = PI.Pid;
402 bool WaitUntilTerminates = false;
403 if (!SecondsToWait) {
404 WaitUntilTerminates = true;
405 } else {
406 if (*SecondsToWait == 0)
407 WaitPidOptions = WNOHANG;
408
409 // Install a timeout handler. The handler itself does nothing, but the
410 // simple fact of having a handler at all causes the wait below to return
411 // with EINTR, unlike if we used SIG_IGN.
412 memset(&Act, 0, sizeof(Act));
413 Act.sa_handler = TimeOutHandler;
414 sigemptyset(&Act.sa_mask);
415 sigaction(SIGALRM, &Act, &Old);
416 // FIXME The alarm signal may be delivered to another thread.
417 alarm(*SecondsToWait);
418 }
419
420 // Parent process: Wait for the child process to terminate.
421 int status = 0;
422 ProcessInfo WaitResult;
423#ifndef __Fuchsia__
424 rusage Info;
425 if (ProcStat)
426 ProcStat->reset();
427
428 do {
429 WaitResult.Pid = sys::wait4(ChildPid, &status, WaitPidOptions, &Info);
430 } while (WaitUntilTerminates && WaitResult.Pid == -1 && errno == EINTR);
431#endif
432
433 if (WaitResult.Pid != PI.Pid) {
434 if (WaitResult.Pid == 0) {
435 // Non-blocking wait.
436 return WaitResult;
437 } else {
438 if (SecondsToWait && errno == EINTR && !Polling) {
439 // Kill the child.
440 kill(PI.Pid, SIGKILL);
441
442 // Turn off the alarm and restore the signal handler
443 alarm(0);
444 sigaction(SIGALRM, &Old, nullptr);
445
446 // Wait for child to die
447 // FIXME This could grab some other child process out from another
448 // waiting thread and then leave a zombie anyway.
449 if (wait(&status) != ChildPid)
450 MakeErrMsg(ErrMsg, "Child timed out but wouldn't die");
451 else
452 MakeErrMsg(ErrMsg, "Child timed out", 0);
453
454 WaitResult.ReturnCode = -2; // Timeout detected
455 return WaitResult;
456 } else if (errno != EINTR) {
457 MakeErrMsg(ErrMsg, "Error waiting for child process");
458 WaitResult.ReturnCode = -1;
459 return WaitResult;
460 }
461 }
462 }
463
464 // We exited normally without timeout, so turn off the timer.
465 if (SecondsToWait && !WaitUntilTerminates) {
466 alarm(0);
467 sigaction(SIGALRM, &Old, nullptr);
468 }
469
470#ifndef __Fuchsia__
471 if (ProcStat) {
472 std::chrono::microseconds UserT = toDuration(Info.ru_utime);
473 std::chrono::microseconds KernelT = toDuration(Info.ru_stime);
474 uint64_t PeakMemory = 0;
475#if !defined(__HAIKU__) && !defined(__MVS__)
476 PeakMemory = static_cast<uint64_t>(Info.ru_maxrss);
477#endif
478 *ProcStat = ProcessStatistics{UserT + KernelT, UserT, PeakMemory};
479 }
480#endif
481
482 // Return the proper exit status. Detect error conditions
483 // so we can return -1 for them and set ErrMsg informatively.
484 int result = 0;
485 if (WIFEXITED(status)) {
486 result = WEXITSTATUS(status);
487 WaitResult.ReturnCode = result;
488
489 if (result == 127) {
490 if (ErrMsg)
491 *ErrMsg = llvm::sys::StrError(ENOENT);
492 WaitResult.ReturnCode = -1;
493 return WaitResult;
494 }
495 if (result == 126) {
496 if (ErrMsg)
497 *ErrMsg = "Program could not be executed";
498 WaitResult.ReturnCode = -1;
499 return WaitResult;
500 }
501 } else if (WIFSIGNALED(status)) {
502 if (ErrMsg) {
503 *ErrMsg = strsignal(WTERMSIG(status));
504#ifdef WCOREDUMP
505 if (WCOREDUMP(status))
506 *ErrMsg += " (core dumped)";
507#endif
508 }
509 // Return a special value to indicate that the process received an unhandled
510 // signal during execution as opposed to failing to execute.
511 WaitResult.ReturnCode = -2;
512 }
513 return WaitResult;
514}
515
516std::error_code llvm::sys::ChangeStdinMode(fs::OpenFlags Flags) {
517 if (!(Flags & fs::OF_Text))
518 return ChangeStdinToBinary();
519 return std::error_code();
520}
521
522std::error_code llvm::sys::ChangeStdoutMode(fs::OpenFlags Flags) {
523 if (!(Flags & fs::OF_Text))
524 return ChangeStdoutToBinary();
525 return std::error_code();
526}
527
528std::error_code llvm::sys::ChangeStdinToBinary() {
529#ifdef __MVS__
530 return disablezOSAutoConversion(STDIN_FILENO);
531#else
532 // Do nothing, as Unix doesn't differentiate between text and binary.
533 return std::error_code();
534#endif
535}
536
537std::error_code llvm::sys::ChangeStdoutToBinary() {
538 // Do nothing, as Unix doesn't differentiate between text and binary.
539 return std::error_code();
540}
541
542std::error_code
544 WindowsEncodingMethod Encoding /*unused*/) {
545 std::error_code EC;
546 llvm::raw_fd_ostream OS(FileName, EC,
548
549 if (EC)
550 return EC;
551
552 OS << Contents;
553
554 if (OS.has_error())
555 return make_error_code(errc::io_error);
556
557 return EC;
558}
559
561 ArrayRef<StringRef> Args) {
562 static long ArgMax = sysconf(_SC_ARG_MAX);
563 // POSIX requires that _POSIX_ARG_MAX is 4096, which is the lowest possible
564 // value for ARG_MAX on a POSIX compliant system.
565 static long ArgMin = _POSIX_ARG_MAX;
566
567 // This the same baseline used by xargs.
568 long EffectiveArgMax = 128 * 1024;
569
570 if (EffectiveArgMax > ArgMax)
571 EffectiveArgMax = ArgMax;
572 else if (EffectiveArgMax < ArgMin)
573 EffectiveArgMax = ArgMin;
574
575 // System says no practical limit.
576 if (ArgMax == -1)
577 return true;
578
579 // Conservatively account for space required by environment variables.
580 long HalfArgMax = EffectiveArgMax / 2;
581
582 size_t ArgLength = Program.size() + 1;
583 for (StringRef Arg : Args) {
584 // Ensure that we do not exceed the MAX_ARG_STRLEN constant on Linux, which
585 // does not have a constant unlike what the man pages would have you
586 // believe. Since this limit is pretty high, perform the check
587 // unconditionally rather than trying to be aggressive and limiting it to
588 // Linux only.
589 if (Arg.size() >= (32 * 4096))
590 return false;
591
592 ArgLength += Arg.size() + 1;
593 if (ArgLength > size_t(HalfArgMax)) {
594 return false;
595 }
596 }
597
598 return true;
599}
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
std::string Name
#define I(x, y, z)
Definition: MD5.cpp:58
static bool Execute(ProcessInfo &PI, StringRef Program, ArrayRef< StringRef > Args, std::optional< ArrayRef< StringRef > > Env, ArrayRef< std::optional< StringRef > > Redirects, unsigned MemoryLimit, std::string *ErrMsg, BitVector *AffinityMask, bool DetachProcess)
Basic Register Allocator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
This file contains some functions that are useful when dealing with strings.
static bool MakeErrMsg(std::string *ErrMsg, const std::string &prefix, int errnum=-1)
This function builds an error message into ErrMsg using the prefix string and the Unix error number g...
Definition: Unix.h:55
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:163
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:66
Represents either an error or a value T.
Definition: ErrorOr.h:56
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition: SmallString.h:26
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1196
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:229
constexpr size_t size() const
size - Get the string size.
Definition: StringRef.h:150
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:144
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
Definition: StringSaver.h:21
StringRef save(const char *S)
Definition: StringSaver.h:30
A raw_ostream that writes to a file descriptor.
Definition: raw_ostream.h:460
std::vector< std::string > ArgVector
LVOptions & options()
Definition: LVOptions.h:445
std::error_code status(const Twine &path, file_status &result, bool follow=true)
Get file status as if by POSIX stat().
bool exists(const basic_file_status &status)
Does file exist?
Definition: Path.cpp:1077
@ OF_TextWithCRLF
The file should be opened in text mode and use a carriage linefeed '\r '.
Definition: FileSystem.h:763
std::chrono::nanoseconds toDuration(FILETIME Time)
std::string StrError()
Returns a string representation of the errno value, using whatever thread-safe variant of strerror() ...
Definition: Errno.cpp:26
std::error_code ChangeStdinMode(fs::OpenFlags Flags)
std::error_code ChangeStdinToBinary()
ProcessInfo Wait(const ProcessInfo &PI, std::optional< unsigned > SecondsToWait, std::string *ErrMsg=nullptr, std::optional< ProcessStatistics > *ProcStat=nullptr, bool Polling=false)
This function waits for the process specified by PI to finish.
bool commandLineFitsWithinSystemLimits(StringRef Program, ArrayRef< StringRef > Args)
Return true if the given arguments fit within system-specific argument length limits.
std::error_code ChangeStdoutMode(fs::OpenFlags Flags)
WindowsEncodingMethod
File encoding options when writing contents that a non-UTF8 tool will read (on Windows systems).
Definition: Program.h:172
std::error_code ChangeStdoutToBinary()
std::error_code writeFileWithEncoding(StringRef FileName, StringRef Contents, WindowsEncodingMethod Encoding=WEM_UTF8)
Saves the UTF8-encoded contents string into the file FileName using a specific encoding.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
std::error_code make_error_code(BitcodeError E)
This struct encapsulates information about a process.
Definition: Program.h:46
process_t Process
The process identifier.
Definition: Program.h:50
int ReturnCode
Platform-dependent process object.
Definition: Program.h:53
This struct encapsulates information about a process execution.
Definition: Program.h:59