> -----Ursprüngliche Nachricht-----
> Von: Gilles Chanteperdrix [mailto:[EMAIL PROTECTED] 
> Gesendet: Donnerstag, 16. Oktober 2008 11:48
> An: Wildenburg, Roderik RAEK3 MRA
> Cc: [email protected]
> Betreff: Re: [Xenomai-help] how to build a Xenomai posix library ?
> 
> [EMAIL PROTECTED] 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 ??
I call shm_open in the following way :
#define LOGSHMNAME   "/var/logshm"
oflags=O_RDWR;
*shmfd = shm_open(LOGSHMNAME, oflags, 0);

Again, linking my application with all the wrappers defined builds a well 
working application. So, for me, the SHM-constructs are o.K., but linking 
builds different applications, depending on the wrappers.

Here is the console output of linking without wrappers:
ppc-linux-gcc -I/opt/eldk/xenomai/include -I/opt/eldk/xenomai/include/posix 
-D_GNU_SOURCE -D_REENTRANT -D__XENO__ -g -Wall  pecomlog.c -c -o pecomlog.o
ppc-linux-gcc   -L/opt/eldk/xenomai/lib -lpthread_rt -lrt -Wall -o pecomlog  
pecomlog.o loglib.a

where loglib.a is my new Xenomay library and pecomlog is my application.

many thanks for your help !

Achtung: Neue E-Mail-Adresse! Attention: New e-mail-address! [EMAIL PROTECTED]
--------------------------------------------------------
manroland AG
Vorsitzender des Aufsichtsrates: Hanno C. Fiedler
Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall, Paul 
Steidle   
Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht 
Offenbach HRB-Nr. 42592
USt-Ident-Nr. DE 250200933

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to