[cs631apue] how execlp works?

Runxi Ding rding6 at stevens.edu
Thu Sep 1 11:02:21 EDT 2016


I read source code of the simple_shell.c and found the following code:

              /* child */
              execlp(buf, buf, (char *)0);
              fprintf(stderr, "shell: couldn't exec %s: %s\n", buf,
                      strerror(errno));
              exit(EX_DATAERR);


*Shouldn't the program print error every time? * The fact is that codes
under execlp never get executed if execlp works properly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20160901/9b8e8b7c/attachment.html>


More information about the cs631apue mailing list