#include #include #include #include #include int main(int argc, char *argv[]) { if (argc < 2) { printf("No path to executable to start provided\n"); return 255; } if (syscall(SYS_close_range, 3U, ~0U, 0U)) { printf("Failed to close file descriptors: %s\n", strerror(errno)); return 255; } if (execv(argv[1], &argv[1])) { printf("Exec %s failed: %s\n", argv[1], strerror(errno)); return 255; } return 0; }