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