开发者

C++ get service network status linux

开发者 https://www.devze.com 2023-02-06 04:16 出处:网络
How can I get in my 开发者_开发技巧linux machine the network service status (like service network status in terminal) from C++?You\'ll probably want to use a call like exec or execv. They\'re availabl

How can I get in my 开发者_开发技巧linux machine the network service status (like service network status in terminal) from C++?


You'll probably want to use a call like exec or execv. They're available if you include "unistd.h" . For more information on how they work, either look at the man page for exec with man exec or look here:

system can also be used. Like -

#include <stdlib.h>
int main() {
system("ls -l");
printf("This is a directory list...");
}

you can use iftop command to find network stats in linux.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号