//===- SystemUtils.h - Utilities to do low-level system stuff --*- C++ -*--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
//
// This file contains functions used to do a variety of low-level, often
// system-specific, tasks.
#include "Config/sys/wait.h"
#include "Config/unistd.h"
#include "Config/errno.h"
+using namespace llvm;
/// isExecutableFile - This function returns true if the filename specified
/// exists and is executable.
///
-bool isExecutableFile(const std::string &ExeFileName) {
+bool llvm::isExecutableFile(const std::string &ExeFileName) {
struct stat Buf;
if (stat(ExeFileName.c_str(), &Buf))
return false; // Must not be executable!
/// directory, nor in the PATH. If the executable cannot be found, return an
/// empty string.
///
-std::string FindExecutable(const std::string &ExeName,
- const std::string &ProgramPath) {
+std::string llvm::FindExecutable(const std::string &ExeName,
+ const std::string &ProgramPath) {
// First check the directory that bugpoint is in. We can do this if
// BugPointPath contains at least one / character, indicating that it is a
// relative path to bugpoint itself.
/// the calling program if there is an error executing the specified program.
/// It returns the return value of the program, or -1 if a timeout is detected.
///
-int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
- const std::string &StdInFile,
- const std::string &StdOutFile,
- const std::string &StdErrFile) {
-
+int llvm::RunProgramWithTimeout(const std::string &ProgramPath,
+ const char **Args,
+ const std::string &StdInFile,
+ const std::string &StdOutFile,
+ const std::string &StdErrFile) {
// FIXME: install sigalarm handler here for timeout...
int Child = fork();
//
// This function does not use $PATH to find programs.
//
-int
-ExecWait (const char * const old_argv[], const char * const old_envp[])
-{
+int llvm::ExecWait(const char * const old_argv[],
+ const char * const old_envp[]) {
// Child process ID
register int child;
//
return 1;
}
-