Re: fork/execv - how to get errno to the parent



Kasper Dupont wrote:
Jordan Abel wrote:

On 2005-09-22, Kasper Dupont <kasperd@xxxxxxxxxxx> wrote:

What you must be aware of is that some of the exec functions
may actually call /bin/sh

System does this. none of the exec functions do.


What distribution are you using? I have been able to reproduce
this on Fedora Core, Source Mage, and FreeBSD. This is the
source code I used:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
char *c="foobar";
execlp(c,c,NULL);
perror(c);
return EXIT_FAILURE;
}
<snip>

Try changing foobar to sleep and rerunning your strace. sh is called
because foobar is a shell script.

Doug
.