exec-null.c 256 B

12345678910111213
  1. /* make sure we handle argv[0] == NULL */
  2. #include <unistd.h>
  3. int main(int argc, char *argv[])
  4. {
  5. if (argc == 0)
  6. return 0;
  7. char *exec_argv[1], *exec_envp[1];
  8. exec_argv[0] = exec_envp[0] = NULL;
  9. return execve("./exec-null", exec_argv, exec_envp);
  10. }