All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Unable to Read from Pipe
@ 2015-06-29 23:57 C Smith
  2015-06-30  0:19 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 7+ messages in thread
From: C Smith @ 2015-06-29 23:57 UTC (permalink / raw)
  To: Xenomai

I am developing a set of applications which write to and read from a
rt_pipe. The writing app is in plain linux userspace, the reading app is a
periodic Xenomai task. I am using xenomai 2.6.3 on kernel 3.4.6 (32 bit).

The problem I have is that the Xenomai task gets this warning when it tries
to read the pipe:
"errno 11 -EWOULDBLOCK" and the bytes the userspace app sent never arrive
at the Xenomai task.

The Xenomai task creates the pipe this way:

ret = rt_pipe_create(&cmd_fifo_fd, "cmd_fifo", 0, 30);

The userspace app opens and writes to the pipe this way:

fd = open("/dev/rtp0", O_RDWR);
wr = write(fd, "Debug", sizeof("Debug"));

The Xenomai task becomes periodic like this:

 ret = rt_task_create(&main_task, "mytask", 0, 99, T_FPU | T_JOINABLE);
 ret = rt_task_start(&main_task, &Periodic_routine, NULL);

Each time the Xenomai periodic task 'wakes', it checks the pipe in a
non-blocking fashion (this is a requirement).
Here is most of the periodic code which reads the pipe:

void Periodic_routine(void *cookie) {
   RTIME next;
   rt_task_set_mode(0, T_WARNSW, NULL);
   next = rt_timer_read();
   while (1)   {
      next += 2000000000;
      retval = rt_task_sleep_until(next);
      retval = rt_pipe_read(&cmd_fifo_fd, msg, 6, TM_NONBLOCK);
   }
}

Yet the rt_pipe_read() above always returns errno 11 -EWOULDBLOCK and never
gets any bytes from the pipe, no matter how many times the periodic task
wakes up.

-CSmith

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-23 16:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29 23:57 [Xenomai] Unable to Read from Pipe C Smith
2015-06-30  0:19 ` Gilles Chanteperdrix
     [not found]   ` <CA+K1mPG9OKH9FReQoC8jLRAipJ3F=vSdRMmtrxFaZEJjyfHArg@mail.gmail.com>
2015-07-01 17:54     ` Gilles Chanteperdrix
2015-07-02 23:14       ` C Smith
2015-07-20 21:31         ` C Smith
2015-07-21  8:26           ` Philippe Gerum
2015-07-23 16:27             ` C Smith

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.