All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Frederik Bayart <frederik.bayart@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] --posix-ldflags and rt_task_shadow() of main
Date: Thu, 30 Apr 2009 14:12:14 +0200	[thread overview]
Message-ID: <49F9959E.2020504@domain.hid> (raw)
In-Reply-To: <1a8178a117805c2dc47266d6a1b9d49f.squirrel@domain.hid>

Frederik Bayart wrote:
> Hallo,
> 
> I have a following question :
> 
> I have an executable linked linked with
> xeno-config --posix-ldflags
> 
> so depends on :
> libpthread_rt.so.1
> 
> If I want to turn my main function into a realtime task with
> rt_task_shadow like code sample below, EBUSY is returned and I get the
> message :
> 
> rt_task_shadow() failed: Device or resource busy.
> 
> This would mean that my main task is already a realtime task and I don't
> have to call rt_task_shadow anymore. Is this correct ? It seems very
> strange to me and I didn't find any documentation which confirms that if
> you link with posix-flags your main thread is automatically realtime.
> 
> I don't get this message if I link with the xeno-config --xeno-ldflags,
> but the reason that I want to link with the posix flags is that I also
> use the shm_open function in my binary.

You are correct, the main thread is automatically shadowed by the POSIX
skin library. This makes things much more consistent, and simplifies the
user experience: an applications using the POSIX API continues to
compile and to work without further changes with Xenomai posix skin,
automatically using Xenomai posix skin services when they exist.

You can disable this behaviour with the configure --enable-dlopen option.

Note that POSIX skin shared memory services are only useful to share
memory between kernel and user-space using the posix API. If you want to
share memory between user-space real-time applications, you can simply
use the libc shared memory services.

-- 
                                                 Gilles.


      reply	other threads:[~2009-04-30 12:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-30 10:10 [Xenomai-help] --posix-ldflags and rt_task_shadow() of main Frederik Bayart
2009-04-30 12:12 ` Gilles Chanteperdrix [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=49F9959E.2020504@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=frederik.bayart@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.