aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llee/SysUtils.h
blob: 2e498a80e8b740ae5fba22cbd152afb840a39fe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*===- SysUtils.h - Utilities to do low-level system stuff -------*- C -*--===*\
 *                                                                            *
 * This file contains functions used to do a variety of low-level, often      *
 * system-specific, tasks.                                                    *
 *                                                                            *
\*===----------------------------------------------------------------------===*/

#ifndef SYSUTILS_H
#define SYSUTILS_H

struct stat;

/*
 * isExecutable - This function returns true if given struct stat describes the
 * file as being executable.
 */ 
unsigned isExecutable(const struct stat *buf);
  
/*
 * isExecutableFile - This function returns true if the filename specified
 * exists and is executable.
 */
unsigned isExecutableFile(const char *ExeFileName);

/*
 * FindExecutable - Find a named executable in the path.
 */ 
char *FindExecutable(const char *ExeName);

/*
 * This method finds the real `execve' call in the C library and executes the
 * given program.
 */
int
executeProgram(const char *filename, char *const argv[], char *const envp[]);

#endif