[Xenomai] Compilation flags to chose mercury API over cobalt

Giulio Moro g.moro at qmul.ac.uk
Mon Dec 18 10:55:59 CET 2017

Passing the options returned by `xeno-config --skin=posix --ldflags` to the linker will automatically "wrap" the calls to most `posix_` functions (full list at /usr/xenomai/lib/posix.wrappers). When a function (e.g.: pthread_create() ) is "wrapped", then all the calls to `pthread_create()` will be replaced by calls to __wrap_pthread_create(). The wrapped version is implemented by xenomai. If you want to call the corresponding Linux service you can call the equivalent `__real_` function. So in order to create a Linux thread you can call `__real_pthread_create()` in your code.
Note: you may have to declare the __real_ function(s) yourself, using the appropriate function signature.


> On 18 Dec 2017, at 09:38, Bastien COUNILH <bcounilh at numalliance.com> wrote:
> Hello,
> I am programming an application that runs in the secondary zone, communicating with a primary zone application.
> (Briefly , in the primary zone , i do data acquisition that I write in a shared memory. When i'm done writing data, i send a signal to my seondary zone program through a pipe to start its data analysis).
> When it recieves the pipe signal, my function launches a series of calculation and verifications.
> As it is not necessary done in a precise sequence, i decided to run the calculcations and the verification in parallel threads. It allows to gain execution time on the heavy calculations, but also to shut the program down faster if an error is returned by my data verification.
> My problem is :
> - I use the function pthread_create that is defined both in linux standard library and Cobalt core. These threads have to be created in the secondary zone. Is there a compilation flag that will allow me to use the regular ptrhead functions ratehr than Xenomai API ones ?
> _______________________________________________
> Xenomai mailing list
> Xenomai at xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai

More information about the Xenomai mailing list