Philippe Gerum <[EMAIL PROTECTED]> wrote on 21.11.2005 13:36:41:
> Dmitry Adamushko wrote:
> > Ignacio García Pérez <[EMAIL PROTECTED]> wrote on 21.11.2005 12:24:57:
> >
> > > Dmitry Adamushko wrote:
> > >
> > > > /* Return buffer is too small - message is lost. */
> > > > ret = -ENOSPC; <---- That's the error you are getting.
> > > >
> > > Maybe "No space left on device" is a bit misleading. Wouldn't ENOMEM fit
> > > better? (or event EINVAL)
> > >
> >
> > Actually, looking now at the linux sources, -ENOSPC is used for
> > describing the same reason (buffer is not big enough) in some places;
> > although there is, at least, one more value -ENOBUFS that's used for the
> > same reason.
> >
> > #define ENOSPC 28 /* No space left on device */
> > #define ENOBUFS 105 /* No buffer space available */
> >
> > So it looks like both may be used in the same context but, I guess, a
> > definition of -ENOBUFS is less confusing.
> >
> >
>
> Let's fix this.
>
Enclosed.
One more thing about xnpipe_read() though.
...
}
else
/* Return buffer is too small - message is lost. */
ret = -ENOBUFS;
So the message is lost in such a case. We may easily avoid that by making a proper check of the size when we are still in the locked section and putting the message back into the queue (prependq() of course). I think that would be more sane.
> --
>
> Philippe.
---
Best regards,
Dmitry
(See attached file: pipe-ENOBUFS.patch)(See attached file: ChangeLog.patch)
pipe-ENOBUFS.patch
Description: Binary data
ChangeLog.patch
Description: Binary data
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
