A quote from the AT&T SVR4 STREAMS programming guide:

"...If a user just wants to get the first message off the queue, the integer pointed to by flagsp should be set to MSG_ANY and the integer pointed to by bandp should be set to 0."

This clearly allows for band 0 operations.

-- Dave

"Brian F. G. Bidulock" wrote:

Dave,

Actually, this is not correct.  It is invalid to call
getpmsg with a band of 0.  It should return an error.

--brian

On Mon, 29 Oct 2001, [EMAIL PROTECTED] wrote:

> Your case looks to me like it should work OK.  You might try running
> "streams -d0x200" and trying it again.  Look in /var/log/messages.
> Maybe LiS will give a hint as to why it doesn't like your use of
> getpmsg.
> -- Dave
>
> David Lehmann wrote:
>
> > Dave Grothe wrote:
> > >
> > > As far as I know getpmsg works.  Watch out for the flags, they are
> > > different than with plain old getmsg.
> >
> > The flags are correct... I think. :-)
> > I am porting from Solaris, so I am pretty sure the code is
> > correct.
> >
> > (I do not need to worry about messages bands
> > anymore, so getmsg will suffice.)
> >
> > Nevertheless, here is my code fragment:
> >         cntl.buf = (char *)&sctp_cntl;
> >         cntl.maxlen = sizeof(sctp_cntl);
> >         flags = 0;
> >
> >         flags = MSG_BAND;
> >         band = SCTP_DATA_PRI;
> >         if (getpmsg(fd, &cntl, NULL, &band, &flags) < 0)
> >
> > where SCTP_DATA_PRI is 0.
> >
> > The code that works is:
> >         cntl.buf = (char *)&sctp_cntl;
> >         cntl.maxlen = cntl.len = sizeof(sctp_cntl);
> >         flags = 0;
> >
> >         if (getmsg(fd, &cntl, NULL, &flags) == -1)
> >
> > Let me know if my parameters are incorrect.
> >
> > -David

--
Brian F. G. Bidulock    ¦ The reasonable man adapts himself to the ¦
[EMAIL PROTECTED]    ¦ world; the unreasonable one persists in  ¦
http://www.openss7.org/ ¦ trying  to adapt the  world  to himself. ¦
                        ¦ Therefore  all  progress  depends on the ¦
                        ¦ unreasonable man. -- George Bernard Shaw ¦

Reply via email to