2 * Copyright (c) 2004-2005, 2010-2011 Todd C. Miller <Todd.Miller@courtesan.com>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 #include <sys/types.h>
30 * Dummy versions of the execve() family of syscalls. We don't need
31 * to stub out all of them, just the ones that correspond to actual
32 * system calls (which varies by OS). Note that it is still possible
33 * to access the real syscalls via the syscall() interface but very
34 * few programs actually do that.
47 #define DUMMY2(fn, t1, t2) \
52 #define DUMMY3(fn, t1, t2, t3) \
54 fn(t1 a1, t2 a2, t3 a3) \
57 #define DUMMY_VA(fn, t1, t2) \
59 fn(t1 a1, t2 a2, ...) \
62 DUMMY_VA(execl, const char *, const char *)
63 DUMMY_VA(_execl, const char *, const char *)
64 DUMMY_VA(__execl, const char *, const char *)
65 DUMMY_VA(execle, const char *, const char *)
66 DUMMY_VA(_execle, const char *, const char *)
67 DUMMY_VA(__execle, const char *, const char *)
68 DUMMY_VA(execlp, const char *, const char *)
69 DUMMY_VA(_execlp, const char *, const char *)
70 DUMMY_VA(__execlp, const char *, const char *)
71 DUMMY2(execv, const char *, char * const *)
72 DUMMY2(_execv, const char *, char * const *)
73 DUMMY2(__execv, const char *, char * const *)
74 DUMMY2(execvp, const char *, char * const *)
75 DUMMY2(_execvp, const char *, char * const *)
76 DUMMY2(__execvp, const char *, char * const *)
77 DUMMY3(execvP, const char *, const char *, char * const *)
78 DUMMY3(_execvP, const char *, const char *, char * const *)
79 DUMMY3(__execvP, const char *, const char *, char * const *)
80 DUMMY3(execve, const char *, char * const *, char * const *)
81 DUMMY3(_execve, const char *, char * const *, char * const *)
82 DUMMY3(__execve, const char *, char * const *, char * const *)
83 DUMMY3(fexecve, int , char * const *, char * const *)
84 DUMMY3(_fexecve, int , char * const *, char * const *)
85 DUMMY3(__fexecve, int , char * const *, char * const *)