New feature testcase for simplifycfg.
[oota-llvm.git] / tools / llee / SysUtils.h
1 /*===- SysUtils.h - Utilities to do low-level system stuff -------*- C -*--===*\
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 // 
10  *                                                                            *
11  * This file contains functions used to do a variety of low-level, often      *
12  * system-specific, tasks.                                                    *
13  *                                                                            *
14 \*===----------------------------------------------------------------------===*/
15
16 #ifndef SYSUTILS_H
17 #define SYSUTILS_H
18
19 struct stat;
20
21 /*
22  * isExecutable - This function returns true if given struct stat describes the
23  * file as being executable.
24  */ 
25 unsigned isExecutable(const struct stat *buf);
26   
27 /*
28  * isExecutableFile - This function returns true if the filename specified
29  * exists and is executable.
30  */
31 unsigned isExecutableFile(const char *ExeFileName);
32
33 /*
34  * FindExecutable - Find a named executable in the path.
35  */ 
36 char *FindExecutable(const char *ExeName);
37
38 /*
39  * This method finds the real `execve' call in the C library and executes the
40  * given program.
41  */
42 int
43 executeProgram(const char *filename, char *const argv[], char *const envp[]);
44
45 #endif