user1056521
user1056521

Reputation:

“execle ” difference between linux and embedded linux

Using x86 platform , I want to start my application named myapp through this method:execl("./myapp","");It's OK! But failed when I'm using ARM platform + embedded linux. Why ? Any help will be appreciated. Thanks in advance.

Upvotes: 3

Views: 398

Answers (2)

Carina
Carina

Reputation: 2260

If you would like to use execle to pass in the same environment that your calling application had, you can use this:

#include <unistd.h>
extern char **environ;

/* ... */
execle("./myApp","./myApp",NULL,environ);  

Upvotes: 2

fge
fge

Reputation: 121820

Your invocation is wrong: execl()'s argument list MUST be terminated with NULL.

The fact that it works at all on x86 is a miracle ;)

Upvotes: 3

Related Questions