1 //===- SystemUtils.h - Utilities to do low-level system stuff --*- C++ -*--===//
3 // This file contains functions used to do a variety of low-level, often
4 // system-specific, tasks.
6 //===----------------------------------------------------------------------===//
13 /// isExecutableFile - This function returns true if the filename specified
14 /// exists and is executable.
16 bool isExecutableFile(const std::string &ExeFileName);
18 // FindExecutable - Find a named executable, giving the argv[0] of bugpoint.
19 // This assumes the executable is in the same directory as bugpoint itself.
20 // If the executable cannot be found, return an empty string.
22 std::string FindExecutable(const std::string &ExeName,
23 const std::string &BugPointPath);
25 /// RunProgramWithTimeout - This function executes the specified program, with
26 /// the specified null-terminated argument array, with the stdin/out/err fd's
27 /// redirected, with a timeout specified on the commandline. This terminates
28 /// the calling program if there is an error executing the specified program.
29 /// It returns the return value of the program, or -1 if a timeout is detected.
31 int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
32 const std::string &StdInFile = "",
33 const std::string &StdOutFile = "",
34 const std::string &StdErrFile = "");