请问一下getmsg()这个函数。。。

APUE中程序14-10,我在linux中一直不能正确运行,
显示: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到这个函数,用起来却报错,说没有实现这个函数

作者: nick_lhy   发布时间: 2011-02-13