请问一下getmsg()这个函数。。。
时间:2011-02-12
来源:互联网
APUE中程序14-10,我在linux中一直不能正确运行,
显示:getmsg error: Function not implemented
GOOGLE了一下居然有人说linux没实现STREAMS功能,但是为什么man的到getmsg(),而且手册里的说明也十分正常。。。
恳请高手讲解一下
C/C++ code
显示:getmsg error: Function not implemented
GOOGLE了一下居然有人说linux没实现STREAMS功能,但是为什么man的到getmsg(),而且手册里的说明也十分正常。。。
恳请高手讲解一下
C/C++ code
#include<stropts.h> #include"apue.h" #define BUFFSIZE 4096 int main() { int n, flag; char ctlbuf[BUFFSIZE], datbuf[BUFFSIZE]; struct strbuf ctl, dat; ctl.buf = ctlbuf; ctl.maxlen = BUFFSIZE; dat.buf = datbuf; dat.maxlen = BUFFSIZE; for(;;) { flag = 0; if((n = getmsg(STDIN_FILENO, &ctl, &dat, &flag)) < 0) err_sys("getmsg error"); fprintf(stderr, "flag = %d, ctl.len = %d, dat.len = %d\n", flag, ctl.len, dat.len); if(dat.len == 0) exit(0); else if(dat.len > 0) if(write(STDOUT_FILENO, dat.buf, dat.len) != dat.len) err_sys("write error"); } }
作者: nick_lhy 发布时间: 2011-02-12
three new functions were added to the SVR3 kernel to support STREAMS (getmsg, putmsg, and poll), and another two (getpmsg and putpmsg) were added with SVR4 to handle messages with different priority bands within a stream
我没用过getmsg。
我发现我的linux 中man getmsg之后找不到
作者: feiyinzilgd 发布时间: 2011-02-13
引用 1 楼 feiyinzilgd 的回复:
three new functions were added to the SVR3 kernel to support STREAMS (getmsg, putmsg, and poll), and another two (getpmsg and putpmsg) were added with SVR4 to handle messages with different priority b……
谢谢,我后来发现linux对STREAMS是不要求支持的,不过还是纳闷为什么我的系统可以man到这个函数,用起来却报错,说没有实现这个函数 three new functions were added to the SVR3 kernel to support STREAMS (getmsg, putmsg, and poll), and another two (getpmsg and putpmsg) were added with SVR4 to handle messages with different priority b……
作者: nick_lhy 发布时间: 2011-02-13
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28