From: Philippe Gerum <rpm@xenomai.org>
To: Marco Jackel <ich@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Re: problem with reading from rt_pipe with a normal linux process
Date: Thu, 03 Aug 2006 19:46:38 +0200 [thread overview]
Message-ID: <1154627199.5010.135.camel@domain.hid> (raw)
In-Reply-To: <eas7hg$umm$1@domain.hid>
On Thu, 2006-08-03 at 09:10 +0200, Marco Jackel wrote:
> Jan Kiszka wrote:
> > Marco Jackel wrote:
> >> Jan Kiszka wrote:
> >>> Hint: read returns its error code in errno. What does that one tell you?
> >> read returns -1, "operation not permitted"
> >>
> >
> > errno == EPERM? A bit weird. Try strace'ing both your program and the
> > cat tool to look for a difference.
> strace says "-1" in this case is ENOBUFS
>
> The failure in my programm is that it writes binary data to a pipe with
> rt_pipe_write (preserves message boundary) and normal linux process
> wants to read it byte by byte with read(). Read wants to receive the
> whole message, but the message is bigger than 1 byte, so it returns ENOBUFS.
>
Yep. Well, I agree that this is clearly not the best designed part of
the entire interface...
> The solution is to use rt_pipe_stream (don't preserves message
> boundary). Do I have to use rt_pipe_alloc before?
No, rt_pipe_stream() manages an internal buffer to convey the byte
stream, and deals with the rt_pipe_alloc/free interface on its own. You
just need to pass it the raw data buffer and size.
> Is there a small
> sample program somewhere?
>
>
> Thanks,
> Marco
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
prev parent reply other threads:[~2006-08-03 17:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-02 18:46 [Xenomai-help] problem with reading from rt_pipe with a normal linux process Marco Jackel
2006-08-02 18:53 ` [Xenomai-help] " Marco Jackel
2006-08-02 18:58 ` Jan Kiszka
2006-08-02 19:07 ` Marco Jackel
2006-08-02 19:38 ` Jan Kiszka
2006-08-03 7:10 ` Marco Jackel
2006-08-03 17:46 ` Philippe Gerum [this message]
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=1154627199.5010.135.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=ich@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.