Dmitry V. Levin | 97c8508 | 2013-06-18 16:50:18 +0000 | [diff] [blame] | 1 | #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 | |
| 10 | int 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 Frysinger | 6673ac7 | 2014-08-11 01:31:09 -0400 | [diff] [blame] | 15 | /* Turn off restrictions on tracing if applicable. If the options |
| 16 | * aren't available on this system, that's OK too. */ |
Dmitry V. Levin | 97c8508 | 2013-06-18 16:50:18 +0000 | [diff] [blame] | 17 | (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 | } |