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.
43 #define DUMMY2(fn, t1, t2) \
48 #define DUMMY3(fn, t1, t2, t3) \
50 fn(t1 a1, t2 a2, t3 a3) \
53 #define DUMMY6(fn, t1, t2, t3, t4, t5, t6) \
55 fn(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
58 #define DUMMY_VA(fn, t1, t2) \
60 fn(t1 a1, t2 a2, ...) \
63 DUMMY_VA(execl, const char *, const char *)
64 DUMMY_VA(_execl, const char *, const char *)
65 DUMMY_VA(__execl, const char *, const char *)
66 DUMMY_VA(execle, const char *, const char *)
67 DUMMY_VA(_execle, const char *, const char *)
68 DUMMY_VA(__execle, const char *, const char *)
69 DUMMY_VA(execlp, const char *, const char *)
70 DUMMY_VA(_execlp, const char *, const char *)
71 DUMMY_VA(__execlp, const char *, const char *)
72 DUMMY3(exect, const char *, char * const *, char * const *)
73 DUMMY3(_exect, const char *, char * const *, char * const *)
74 DUMMY3(__exect, const char *, char * const *, char * const *)
75 DUMMY2(execv, const char *, char * const *)
76 DUMMY2(_execv, const char *, char * const *)
77 DUMMY2(__execv, const char *, char * const *)
78 DUMMY2(execvp, const char *, char * const *)
79 DUMMY2(_execvp, const char *, char * const *)
80 DUMMY2(__execvp, const char *, char * const *)
81 DUMMY3(execvP, const char *, const char *, char * const *)
82 DUMMY3(_execvP, const char *, const char *, char * const *)
83 DUMMY3(__execvP, const char *, const char *, char * const *)
84 DUMMY3(execve, const char *, char * const *, char * const *)
85 DUMMY3(_execve, const char *, char * const *, char * const *)
86 DUMMY3(__execve, const char *, char * const *, char * const *)
87 DUMMY3(execvpe, const char *, char * const *, char * const *)
88 DUMMY3(_execvpe, const char *, char * const *, char * const *)
89 DUMMY3(__execvpe, const char *, char * const *, char * const *)
90 DUMMY3(fexecve, int , char * const *, char * const *)
91 DUMMY3(_fexecve, int , char * const *, char * const *)
92 DUMMY3(__fexecve, int , char * const *, char * const *)
94 DUMMY6(posix_spawn, pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *)
95 DUMMY6(_posix_spawn, pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *)
96 DUMMY6(__posix_spawn, pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *)
97 DUMMY6(posix_spawnp, pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *)
98 DUMMY6(_posix_spawnp, pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *)
99 DUMMY6(__posix_spawnp, pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *)
100 #endif /* HAVE_SPAWN_H */