Execv Linux printf funktioniert nicht

Ich versuche, die ausführbare Datei mit folgendem C-Code auszuführen:

  int main(int argc, char *argv[])
  {
     printf("hello.\n");
     sleep(2);
     if (execlp("ls","ls","-l",NULL) == -1)
          printf("Error occured during execute ls.\n");
     return 0;
 }

Warum funktioniert printf ("Hallo \ n") nicht? auch wenn ich schlafe?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage