LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1115|回复: 1

如何解决function not implemented的问题?

[复制链接]
发表于 2007-7-3 17:27:55 | 显示全部楼层 |阅读模式
最近在使用getmsg函数时出现了function not implemented的问题,请问如何解决这个问题?是换libc、linuxheaders还是这个linux内核不支持?我的linuxheaders的版本是2.6.17-386。谢谢!
 楼主| 发表于 2007-7-4 14:35:54 | 显示全部楼层
我Ù个程序书上的例子,用getmsg把标Ɠ入复制到标Ɠú。
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <errno.h>
  5. #include <stropts.h>
  6. #define BUFFSIZE 4096
  7. int main(void)
  8. {
  9.         int n,flag;
  10.         char ctlbuf[BUFFSIZE],datbuf[BUFFSIZE];
  11.         struct strbuf ctl,dat;
  12.         ctl.buf=ctlbuf;
  13.         ctl.maxlen=BUFFSIZE;
  14.         dat.buf=datbuf;
  15.         dat.maxlen=BUFFSIZE;
  16.         for(;;)
  17.         {
  18.                 flag=0;
  19.                 if((n=getmsg(STDIN_FILENO,&ctl,&dat,&flag))<0)
  20.                 {
  21.                         printf("getmsg error: %s.\n",strerror(errno));
  22.                 }
  23.                 fprintf(stderr,"flag=%d, ctl.len=%d, dat.len = %d\n",flag,ctl.len,dat.len);
  24.                 if(dat.len==0)exit(0);
  25.                 else if(dat.len>0)
  26.                         if(write(STDOUT_FILENO,dat.buf,dat.len)!=dat.len)
  27.                                 printf("write error\n");
  28.         }
  29. }
复制代码
Ð行的Ӝ是
getmsg error: Function not implemented.
flag=0, ctl.len=0, dat.len = 0
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表