From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Peter Soetens <peter@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Correct use of xeno_sigshadow_install()
Date: Tue, 11 Jan 2011 12:59:30 +0100 [thread overview]
Message-ID: <4D2C4622.6040708@domain.hid> (raw)
In-Reply-To: <201101111223.46697.peter@domain.hid>
Peter Soetens wrote:
>> - define your own signal and handle correctly both Xenomai and
>> libreadline signals in that handler.
>
> So what I did to get it to work is this:
>
> declare in my own files (a C++ program):
> extern "C"
> int xeno_sigwinch_handler(int sig, siginfo_t *si, void *ctxt);
>
> -> this function is nowhere declared in a header
We can probably arrange that, we would have to put this declaration in a
header included in all the skin headers.
> Then write:
> void rl_sigwinch_handler(int sig, siginfo_t *si, void *ctxt) {
> if (xeno_sigwinch_handler(sig, si, ctxt) == 0)
> rl_resize_terminal();
> }
>
> And when initializing readline:
>
> rl_catch_sigwinch = 0;
> struct sigaction sa;
> sa.sa_sigaction = &rl_sigwinch_handler;
> sa.sa_flags = SA_SIGINFO;
> sigaction(SIGWINCH, &sa, 0);
>
> which works. I have guarded the xenomai-specific code with #if
> CONFIG_XENO_VERSION_MAJOR == 2 && CONFIG_XENO_VERSION_MINOR >= 5
> stanzas. I'm not sure at which exact version this function was introduced.
This was introduced in 2.5.0. So, this is correct. In 2.4, each skin had
its own signal handler, and they ended up being chained if you used
several skins.
--
Gilles.
next prev parent reply other threads:[~2011-01-11 11:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-11 11:23 [Xenomai-help] Correct use of xeno_sigshadow_install() Peter Soetens
2011-01-11 11:59 ` Gilles Chanteperdrix [this message]
2011-01-11 12:15 ` Gilles Chanteperdrix
-- strict thread matches above, loose matches on Subject: below --
2011-01-10 16:18 Peter Soetens
2011-01-10 16:24 ` Gilles Chanteperdrix
2011-01-10 16:41 ` Peter Soetens
2011-01-10 16:50 ` Gilles Chanteperdrix
2011-01-10 20:37 ` Peter Soetens
2011-01-10 20:45 ` Gilles Chanteperdrix
2011-01-10 22:04 ` Gilles Chanteperdrix
2011-01-10 18:25 ` Gilles Chanteperdrix
2011-01-10 20:15 ` Peter Soetens
2011-01-10 20:22 ` Gilles Chanteperdrix
2011-01-10 20:38 ` Peter Soetens
2011-01-10 16:41 ` Gilles Chanteperdrix
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=4D2C4622.6040708@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=peter@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.