使用popen获取命令行的输出结果
int numOfCPU;
FILE *fp = popen("grep -c ^processor /proc/cpuinfo", "r");
fscanf(fp, "%d", &numOfCPU);
pclose(fp);
//获取uname -r的结果,拼接到fd_ctx->libpath
FILE *fp = popen("uname -r","r");
char uname[64] ={0};
fscanf(fp,"%s",uname);
sprintf(fd_ctx->libpath,"/lib/modules/%s",uname);
pclose(fp);