All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: varname <varname@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] rt_pipe_stream: not getting EPIPE
Date: Mon, 21 Feb 2011 21:00:10 +0100	[thread overview]
Message-ID: <1298318410.2075.5.camel@domain.hid> (raw)
In-Reply-To: <AANLkTikH_NciDFN402p-bvPW__K2du9bZRgcS7AUfz+t@domain.hid>

On Mon, 2011-02-21 at 18:54 +0100, varname wrote:
> All,
> 
> trying to write a simple producer / consumer using message pipes in
> the native API, this phrase from the documentation (found here [1])
> confuses me:
> 
> "-EPIPE is returned if the associated special device is not yet open."
> 
> It's not so much the sentence itself, but more the fact that I'm not
> getting that return value from rt_pipe_stream() when streaming bytes
> to a RT_PIPE that hasn't had its "special device" opened in secondary
> domain.
> 
> I've attached a modified trivial-periodic.c that demonstrates what I'm
> seeing. Afaik there is nothing open(2)-ing the /dev/rtp9 in the
> secondary domain. All writes succeed, up to about write 31 (*1024),
> after which all writes return 0.
> 
> [..]
> wrote: 1024, res: 1024
> wrote: 1024, res: 948
> wrote: 1024, res: 0
> wrote: 1024, res: 0
> [..]
> 
> Is the documentation incorrect, or am I misunderstanding something?

The doc is wrong (former implementation, 2.1.x series), the pipe
services do buffer real-time output until the special device is
eventually opened starting with Xenomai 2.2.x. Since you are using
rt_pipe_stream(), the output is directed to an internal buffer until
there is no more space there, which causes the final 0-byte returns.

So everything looks ok, except the doc.

> 
> Related info:
>   Xenomai: 2.5.5.2
>   Kernel: 2.6.32.26
> 
> [1] http://www.xenomai.org/documentation/trunk/html/api/group__pipe.html#gb4d85ecda7675a75611500070c28b22e
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help

-- 
Philippe.




  parent reply	other threads:[~2011-02-21 20:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 17:54 [Xenomai-help] rt_pipe_stream: not getting EPIPE varname
2011-02-21 19:07 ` varname
2011-02-21 20:00 ` Philippe Gerum [this message]
2011-02-21 20:33   ` varname
2011-02-21 21:50     ` Stefan Kisdaroczi
     [not found]   ` <4D62CA75.1050706@domain.hid>
2011-02-21 20:52     ` Philippe Gerum
2011-02-21 21:21       ` varname
2011-02-21 22:50         ` Philippe Gerum
2011-02-21 22:53           ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298318410.2075.5.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=varname@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.