blob: 2e498a80e8b740ae5fba22cbd152afb840a39fe6 [file] [log] [blame]
Misha Brukman593ece02003-08-15 23:31:16 +00001/*===- SysUtils.h - Utilities to do low-level system stuff -------*- C -*--===*\
Misha Brukman0abaaf42003-08-11 22:29:36 +00002 * *
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
Misha Brukman2e1fbdd2003-09-29 22:37:00 +000011struct stat;
12
13/*
14 * isExecutable - This function returns true if given struct stat describes the
15 * file as being executable.
16 */
17unsigned isExecutable(const struct stat *buf);
18
Misha Brukman0abaaf42003-08-11 22:29:36 +000019/*
20 * isExecutableFile - This function returns true if the filename specified
21 * exists and is executable.
22 */
Misha Brukman593ece02003-08-15 23:31:16 +000023unsigned isExecutableFile(const char *ExeFileName);
Misha Brukman0abaaf42003-08-11 22:29:36 +000024
25/*
Misha Brukman593ece02003-08-15 23:31:16 +000026 * FindExecutable - Find a named executable in the path.
Misha Brukman0abaaf42003-08-11 22:29:36 +000027 */
28char *FindExecutable(const char *ExeName);
29
Misha Brukman2e1fbdd2003-09-29 22:37:00 +000030/*
31 * This method finds the real `execve' call in the C library and executes the
32 * given program.
33 */
34int
35executeProgram(const char *filename, char *const argv[], char *const envp[]);
36
Misha Brukman0abaaf42003-08-11 22:29:36 +000037#endif