blob: dbd5337256420fa9562b6db97f1b8c673fb59f9d [file] [log] [blame]
Dmitry V. Levin97c85082013-06-18 16:50:18 +00001#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4#include <stdio.h>
5#include <unistd.h>
6#ifdef HAVE_PRCTL
7# include <sys/prctl.h>
8#endif
9
10int main(int argc, char **argv)
11{
12 if (argc < 2)
13 return 99;
14#if defined HAVE_PRCTL && defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY
Mike Frysinger6673ac72014-08-11 01:31:09 -040015 /* Turn off restrictions on tracing if applicable. If the options
16 * aren't available on this system, that's OK too. */
Dmitry V. Levin97c85082013-06-18 16:50:18 +000017 (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY);
18#endif
19 if (write(1, "\n", 1) != 1) {
20 perror("write");
21 return 99;
22 }
23 (void) execvp(argv[1], argv + 1);
24 perror(argv[1]);
25 return 99;
26}