C++获取服务网络状态linux

问题描述:

如何从C++获取我的Linux机器的网络服务状态(如终端中的服务网络状态)?C++获取服务网络状态linux

您可能要使用类似exec or execv的电话。如果包含“unistd.h”,它们可用。有关它们如何工作的更多信息,请查看有关man execlook here的可执行文件的手册页:

系统也可以使用。像 -

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