From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: roderik.wildenburg@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] how to build a Xenomai posix library ?
Date: Thu, 16 Oct 2008 14:14:37 +0200 [thread overview]
Message-ID: <48F7302D.8050105@domain.hid> (raw)
In-Reply-To: <5D63919D95F87E4D9D34FF7748CE2C2A0155D72A@ARVMAIL1.mra.roland-man.biz>
roderik.wildenburg@domain.hid wrote:
>> -----Ursprüngliche Nachricht-----
>> Von: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
>> Gesendet: Donnerstag, 16. Oktober 2008 11:48
>> An: Wildenburg, Roderik RAEK3 MRA
>> Cc: xenomai@xenomai.org
>> Betreff: Re: [Xenomai-help] how to build a Xenomai posix library ?
>>
>> roderik.wildenburg@domain.hid wrote:
>>> I did so and called, within the library, every
>> posix_rt-function with
>>> the prefix __wrap_ : e.g. __wrap_shm_open then I compiled my
>>> application, which does not use any Xenomai-function, and linked it
>>> with pthread_rt an rt (-lpthread_rt -lrt) and my new Xenomai-library
>>> (linking without any wrapping defined). Linking and
>> compiling did not
>>> produce any error. But, when I call a function in my library, which
>>> in turn calls __wrap_shm_open, then shm_open fails. When I link my
>>> application with wrapping (as provided by the XENO_CONFIG-script)
>>> then everything is fine. Do you have an explanation for
>> this behavior
>>> or even better a solution ?
>> __wrap_shm_open only works if you have the CONFIG_XENO_OPT_POSIX_SHM
>> option enabled. Is it enabled?
>
> yes it is :
> CONFIG_XENO_OPT_POSIX_SHM=y
> otherwise, I think, my application linked with wrappings defined wouldn´t work ? But it does.
>
>> Note that xenomai posix skin shm support
>> is mainly useful for sharing memory between kernel and
>> user-space.
> O.k., I just want to share SHM between applications. What SHM construct should I use instead ?
>
>> If it is enabled, then please tell us what is the value of errno when
>> __wrap_shm_open fails.
>>
>
> shm_open fails. errno=2
> shm_open fails : : No such file or directory
>
> I don´t know what this should mean ??
Well, it means that the shared memory does not exist.
> I call shm_open in the following way :
> #define LOGSHMNAME "/var/logshm"
> oflags=O_RDWR;
> *shmfd = shm_open(LOGSHMNAME, oflags, 0);
a shm name should contain one slash at the beginning and no other slash,
for best portability.
If you want to create a shared memory, you should pass the O_CREAT flag.
This is all documented here:
http://www.xenomai.org/documentation/trunk/html/api/group__posix__shm.html#gf765a0fa9152fbf874436c966f3af7ba
--
Gilles.
next prev parent reply other threads:[~2008-10-16 12:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-14 13:21 [Xenomai-help] how to build a Xenomai posix library ? roderik.wildenburg
2008-10-14 13:35 ` Gilles Chanteperdrix
2008-10-16 9:36 ` roderik.wildenburg
2008-10-16 9:48 ` Gilles Chanteperdrix
2008-10-16 10:14 ` roderik.wildenburg
2008-10-16 12:14 ` Gilles Chanteperdrix [this message]
2008-10-16 12:34 ` roderik.wildenburg
2008-10-16 12:41 ` Gilles Chanteperdrix
2008-10-17 9:58 ` [Xenomai-help] how to build a Xenomai posix library ? solved roderik.wildenburg
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=48F7302D.8050105@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=roderik.wildenburg@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.