All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Jens Köhler" <jenskxxx@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] rt_queue_read and EPERM?
Date: Mon, 13 Sep 2010 13:57:03 +0200	[thread overview]
Message-ID: <4C8E118F.7010404@domain.hid> (raw)
In-Reply-To: <AANLkTik4rjQzwnU82OBudtkeS+kO+fbD1RjFXvXK7=qS@mail.gmail.com>

Jens Köhler wrote:
> Hello Gilles,
>  
> here is the code:
>  
> RT_QUEUE myqueue;
> int retval;
> retval = rt_queue_create(&myqueue, "myqueue", 255, 10, Q_FIFO);
>  
> char message[100] = "Message ";
> retval = rt_queue_write(&myqueue,message,sizeof(message),Q_NORMAL);
> //retval is 0
>  
> char msgBuf[255];
> retval = rt_queue_read(&myqueue, msgBuf, sizeof(msgBuf), TM_NONBLOCK);
> //retval is always -1, why?

Probably because the callling thread is not a Xenomai thread, it is a
simple Linux thread, and as such, is not allowed to switch to primary
mode as is required by rt_queue_read.

-- 
					    Gilles.



  reply	other threads:[~2010-09-13 11:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13  8:06 [Xenomai-help] rt_queue_read and EPERM? Jens Köhler
2010-09-13  9:07 ` Gilles Chanteperdrix
2010-09-13 10:59   ` Jens Köhler
2010-09-13 11:57     ` Gilles Chanteperdrix [this message]
2010-09-13 13:52       ` Jens Köhler
2010-09-13 14:15         ` Gilles Chanteperdrix

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=4C8E118F.7010404@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jenskxxx@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.