Converting bash command to C code
What is the equivalent built in function call in C to kill a process and to shutdown an ethernet card?
Bash code 1) killall smbd > /dev/null 2) ifconfig eth0 down > /dev/null ========================= C code ? 1) 2) |
man system
man execvp I think one of those should help |
And/or
man 2 kill |
or...
If there is a specific C funtion that works then go with that but the less desireable, efficient or professional way would be to use a system command included in unistd.h system("..."); You can use any command that you would issue from the bash prompt just through your application.
:) |
All times are GMT -5. The time now is 10:07 PM. |