473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

sigaction : using "void (*sa_sigaction)(int, siginfo_t *, void *);"

hello,

in sigaction manpage it's written :

sa_sigaction also specifies the action to be associated with signum.
This function receives the signal number as its first argument, a
pointer to a siginfo_t as its second argument and a pointer to a ucon-
text_t (cast to void *) as its third argument.

so we can pass arguments to the signal handler (throught "void*"), but I
can't find the way...
no way to put it anywhere...

example :

void ping(int sig, siginfo_t *siginf, void *ptr)
{
....
}

int main()
{
struct sigaction sa_ping;
int foo;

foo = 3;

sa_ping.sa_sigaction = ping;
sigemptyset(&sa_ping.sa_mask);
sa_ping.sa_flags = 0;
sigaction(SIGUSR1, &sa_ping, 0);
....
}

where I can pass foo value in argument in ping (with a cast in (int *) )???
if someone has an idea, I'll be thankfull

Alexandre
Nov 14 '05 #1
2 5605
Alexandre wrote:

hello,

in sigaction manpage it's written :
[lots of stuff having nothing to do with C]


You probably want comp.unix.programmer. Followups set.

--
Er*********@sun.com
Nov 14 '05 #2
Alexandre wrote:

hello,

in sigaction manpage it's written :
[lots of stuff having nothing to do with C]


You probably want comp.unix.programmer. Followups set.

--
Er*********@sun.com
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ollej Reemt | last post by:
Hello, I would like to know if there is a difference in c++ between the following two method-declarations: void Method(); and void Method(void);
188
by: infobahn | last post by:
printf("%p\n", (void *)0); /* UB, or not? Please explain your answer. */
7
by: sunglo | last post by:
My doubt comes from trying to understand how thread return values work (I know, it's off topic here), and I'm wondering about the meaning of the "void **" parameter that pthread_join expects (I...
1
by: hpandey | last post by:
sigaction : using "void (*sa_sigaction)(int, siginfo_t *, void *);" -------------------------------------------------------------------------------- hello, in sigaction manpage it's written :...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.