[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Execlp

> -----Original Message-----
> From: owner-dev-etrax@xxxxxxx.com 
> [mailto:owner-dev-etrax@xxxxxxx.com] On Behalf Of Eric Chapman
> Sent: den 4 juni 2004 11:15
> Cc: dev-etrax
> Subject: Re: Execlp
> Hi again,
> Here's the part of the code
>    if(execlp("ifconfig","", netdev,"up",NULL)<0){
>             printf("execlp error %s(%d)\n", strerror(errno), errno);
>             exit(1);
>    }

If you are using the busybox ifconfig (which I suspect you are) you
probably need to supply "ifconfig" as arg0 (instead of "") since 
busybox is one executable that uses argv[0] to decide which
"applet" to run.

>  > Have you included <unistd.h> ?
> No, it is not included directly, but via some other files
> Compiling for the i386 host it works as expected. Is it compulsory to 
> include directly for cris-etrax?

No, it doesn't need to be included directly, but because of the CRIS
calling conventions it is important that you do have a correct defintion
of execlp() with ellipsis.