I want to use system()
function of stdlib.h
in my c code. I am actually working on kernel programming.
Whenever i want to use system()
in it, it gives error to stdlib.h
saying no such file found.
3. Execute Shell Script Using . ./ (dot space dot slash) While executing the shell script using “dot space dot slash”, as shown below, it will execute the script in the current shell without forking a sub shell.
It's simple!
#include <linux/kmod.h>
char * envp[] = { "HOME=/", NULL };
char * argv[] = { "/bin/ls", NULL };
call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With