summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/execv.c
blob: efd760253e12c3b97f2933c64a950ecd786c9253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include "exec_lib.h"

int execv(const char *file, char *const argv[]) {
  if (execve(file,argv,environ)==-1) {
    if (errno==ENOEXEC) __exec_shell(file,argv);
  }
  return -1;
}