#include
#include
#include
char info[50];
main() {
int fdr;
int rc = mknod("testfile",'b',0);
if(rc<0) {
perror("Error in mnod");
}
fdr=open("testfile",O_RDONLY);
read(fdr,info,50);
printf("/n Received message=%s",info);
printf("/n");
}
并做一些事情.它在Red Hat系统上运行良好,但在ubuntu上失败,给出了错误无效的参数.
本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/zaicchengxuzhongshiyongubuntushangdemknod.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9月 12, 2019 at 11:23 下午