Results 1 to 5 of 5
Hi all,
Iam using uclibc on uclinux and writing a timer application (where on expiry of timer, a user specified signal is generated). The possible signal handlers are
void func(int ...
- 08-27-2008 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 6
Passing user input to signal handlers.
Hi all,
Iam using uclibc on uclinux and writing a timer application (where on expiry of timer, a user specified signal is generated). The possible signal handlers are
void func(int signal) and
void func(int signo ,siginfo_t* pInfo,void* context) depending whether or not SA_SIGINFO is reset ot not.
But the problem is that there is no way of passing a user input to the signal handler.
Any way of achieving this ?
Vasanth
- 08-27-2008 #2
Do this at the command line:
If that man page is not installed on your system, google for this:Code:man sigqueue
If you choose the linux.die.net site, note that they have written this up under both section 2 and section 3 of the manual. I have no idea why they did that; the documentation under section 2 seems slightly more useful.Code:linux man sigqueue
Hope this helps.--
Bill
Old age and treachery will overcome youth and skill.
- 08-28-2008 #3Just Joined!
- Join Date
- Aug 2008
- Posts
- 6
Hi,
Thanks for the reply.
But the issue is that the signal generation is done automatically on expiration of timer and is not under my control. I can atmost specify the signal to be sent and the signal handler.
glibc does have a provision for specifying a notification function and a notification attribute on expiration of timer.But this facility is unavailable in uclibc.
- 08-28-2008 #4
Oops. My bad. I saw that you were using uclibc, but I didn't know what uclibc was: a replacement, effectively, for glibc.
I imagine you've already eliminated the following possibility, but in case you haven't:
If you only have one timer counting down at a time, why not put the parameter in question into a global, and upon expiration of the timer, let the signal handler pick it up from there?
Maybe a stupid question, but stupid questions are my specialty. :)--
Bill
Old age and treachery will overcome youth and skill.
- 08-28-2008 #5Just Joined!
- Join Date
- Aug 2008
- Posts
- 6
Hi,
Having the input parameter as global is not possible in the present scenario because iam encapsulating the POSIX timer as a C++ class and each object of that class will have a separate input argument. and its not practical for having many global variables as there will be lots of timer objects.


Reply With Quote