blob: 8d1be4e835be5e398b8e3fa2876f5e0f5a13c669 [file] [log] [blame]
Misha Brukman3b87f212004-08-04 21:19:49 +00001/*===- SysUtils.h - Utilities to do low-level system stuff ----------------===*\
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 *
Misha Brukman0abaaf42003-08-11 22:29:36 +000014\*===----------------------------------------------------------------------===*/
15
16#ifndef SYSUTILS_H
17#define SYSUTILS_H
18
Misha Brukman2e1fbdd2003-09-29 22:37:00 +000019struct stat;
20
21/*
22 * isExecutable - This function returns true if given struct stat describes the
23 * file as being executable.
24 */
25unsigned isExecutable(const struct stat *buf);
26
Misha Brukman0abaaf42003-08-11 22:29:36 +000027/*
28 * isExecutableFile - This function returns true if the filename specified
29 * exists and is executable.
30 */
Misha Brukman593ece02003-08-15 23:31:16 +000031unsigned isExecutableFile(const char *ExeFileName);
Misha Brukman0abaaf42003-08-11 22:29:36 +000032
33/*
Misha Brukman593ece02003-08-15 23:31:16 +000034 * FindExecutable - Find a named executable in the path.
Misha Brukman0abaaf42003-08-11 22:29:36 +000035 */
36char *FindExecutable(const char *ExeName);
37
Misha Brukman2e1fbdd2003-09-29 22:37:00 +000038/*
39 * This method finds the real `execve' call in the C library and executes the
40 * given program.
41 */
42int
43executeProgram(const char *filename, char *const argv[], char *const envp[]);
44
Misha Brukman0abaaf42003-08-11 22:29:36 +000045#endif