From: siva kumar <mobi_linux@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: Regrading signal/sigaction.
Date: Tue, 26 Jun 2001 15:54:15 -0700 (PDT) [thread overview]
Message-ID: <20010626225415.26347.qmail@web14805.mail.yahoo.com> (raw)
Hi,
Is it possible to pass any local variable as an
argument in the signal handler function.Basically I
want to print the value of the local variable in the
signal handler function.
In the below program I want to print the value of a in
the timeout function(siganl handler), whenever the
Alaram signal send.
Your comment are welcomed.
My prototype code is:
#include<stdio.h>
#include<signal.h>
void timeout(int signo,int a)
{
printf ("timeout");
printf("the value is %d and %d",signo,a);
}
main()
{
int a =5;
struct sigaction act,oact;
act.sa_handler = timeout;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
sigaction(SIGALRM, &act, &oact);
alarm(10);
sleep(10);
}
Thanks,
siva.s
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
reply other threads:[~2001-06-26 22:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20010626225415.26347.qmail@web14805.mail.yahoo.com \
--to=mobi_linux@yahoo.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®