2e498a80e8b740ae5fba22cbd152afb840a39fe6
[oota-llvm.git] / tools / llee / SysUtils.h
1 /*===- SysUtils.h - Utilities to do low-level system stuff -------*- C -*--===*\
2  *                                                                            *
3  * This file contains functions used to do a variety of low-level, often      *
4  * system-specific, tasks.                                                    *
5  *                                                                            *
6 \*===----------------------------------------------------------------------===*/
7
8 #ifndef SYSUTILS_H
9 #define SYSUTILS_H
10
11 struct stat;
12
13 /*
14  * isExecutable - This function returns true if given struct stat describes the
15  * file as being executable.
16  */ 
17 unsigned isExecutable(const struct stat *buf);
18   
19 /*
20  * isExecutableFile - This function returns true if the filename specified
21  * exists and is executable.
22  */
23 unsigned isExecutableFile(const char *ExeFileName);
24
25 /*
26  * FindExecutable - Find a named executable in the path.
27  */ 
28 char *FindExecutable(const char *ExeName);
29
30 /*
31  * This method finds the real `execve' call in the C library and executes the
32  * given program.
33  */
34 int
35 executeProgram(const char *filename, char *const argv[], char *const envp[]);
36
37 #endif