手机扫码访问

导航
您当前的位置:首页 > 网课类 > 计算机
问题:

高效找答案就上答案窝。欢迎访问daanwo.com
[单选题]下面的程序是为了实现“ls /dev|grep sd”。请选择合适的语句将其补充完整。 #include #include #include main(){ int pipefd[2]; int rv; pipe(pipefd); rv=fork(); if(0==rv){ ________; close(0); dup(pipefd[0]); close(pipefd[0]); execlp("grep", "grep", "sd", NULL); }else{ ________; close(1); dup(pipefd[1]); close(pipefd[1]); execlp("ls", "ls", "/dev", NULL); } }

Aclose(pipefd[1]) close(pipefd[0])hC6答案窝(daanwo.com)-大学作业答案分享平台

Bclose(pipefd[0]) close(pipefd[1])hC6答案窝(daanwo.com)-大学作业答案分享平台

Cclose(pipefd[0]) close(pipefd[0])hC6答案窝(daanwo.com)-大学作业答案分享平台

Dclose(pipefd[1]) close(pipefd[1])hC6答案窝(daanwo.com)-大学作业答案分享平台

高效找答案就上答案窝。欢迎访问daanwo.com
答案解析:

您可能感兴趣的问题
相关问题
关于我们 | 用户指南 | 版权声明 | 给我留言 | 联系我们 | 积分商城 | 答案求助 | 网站地图
Copyright © 2020 www.daanwo.com All Rights Reserved