blob: 4363c9460a4fac7f859b53461cb3fae9ea754444 [file] [log] [blame]
Dmitry V. Levin7c221012015-07-26 11:06:53 +00001#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <unistd.h>
6#include <sys/syscall.h>
7
8#ifdef __NR_execveat
9
10#define FILENAME "execveat\nfilename"
11static const char * const argv[] =
12 { FILENAME, "first", "second", NULL, NULL, NULL };
13static const char * const envp[] =
14 { "foobar=1", "foo\nbar=2", NULL , "", NULL , "", NULL, NULL};
15
16int
17main(void)
18{
19 syscall(__NR_execveat, -100, FILENAME, argv, envp, 0x1100);
20 return 0;
21}
22
23#else
24
25int
26main(void)
27{
28 return 77;
29}
30
31#endif