开发者

C++ get service network status linux

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜