Module: xenomai-forge Branch: rtdm-api-waitqueues Commit: d204e2a2bd1a5301fa66223c3d94e98de183c493 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d204e2a2bd1a5301fa66223c3d94e98de183c493
Author: Philippe Gerum <r...@xenomai.org> Date: Mon Apr 14 15:18:16 2014 +0200 lib/cobalt: introduce XENO_CONFIG_OUTPUT switch variable Defining XENO_CONFIG_OUTPUT in the environment causes the application program linked against libcobalt to dump the configuration settings used for building the user-space programs/libraries. The program exits immediately afterwards. --- lib/cobalt/init.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c index 4592c21..a903814 100644 --- a/lib/cobalt/init.c +++ b/lib/cobalt/init.c @@ -195,6 +195,14 @@ void __libcobalt_init(void) boilerplate_init(); } +static inline void dump_configuration(void) +{ + int n; + + for (n = 0; config_strings[n]; n++) + puts(config_strings[n]); +} + static __libcobalt_ctor void __init_cobalt(void) { pthread_t tid = pthread_self(); @@ -202,6 +210,12 @@ static __libcobalt_ctor void __init_cobalt(void) int policy, ret; const char *p; + p = getenv("XENO_CONFIG_OUTPUT"); + if (p && *p) { + dump_configuration(); + _exit(0); + } + __cobalt_main_tid = tid; if (__cobalt_defer_init) _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git