Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“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.


2 Answers

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 ;)

like image 127
fge Avatar answered Jan 27 '26 21:01

fge


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);  
like image 35
Carina Avatar answered Jan 27 '26 21:01

Carina



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!