File: exec.c

package info (click to toggle)
proot 5.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,012 kB
  • sloc: ansic: 18,627; sh: 1,662; python: 108; asm: 41; makefile: 16; awk: 6
file content (16 lines) | stat: -rw-r--r-- 299 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc, char *argv[], char *envp[])
{
	if (argc < 2) {
		puts("not enough parameter: filename argv[0] argv[1] ... argv[n]");
		exit(EXIT_FAILURE);
	}

	execve(argv[1], &argv[2], envp);
	perror("execve");

	exit(EXIT_FAILURE);
}