what are the differences between the signal()function and the sigaction()function?
when I can use sigaction function?and what are the advantages of use the sigaction functions?
You should read up on Unix man pages. They are broken up into numbered sections. Section 2 is about system calls. Read intro(2) for more information. Section 3 is about library functions. Again, read intro(3) for more information.
Note that at the bottom of each of these linked man pages there are links to other relevant man pages. At the bottom of the intro man pages, there are links to all other intro man pages. It sounds like it would be a good idea if you start by reading all of those.
The signal(2) man page also includes links to other relevant man pages.
The main difference I think, is signal() is used to just install a new signal handler whereas sigaction() can do much more. sigaction() is passed a struct sa_sigaction which can have details like, the signal masks, signal info (eg. how it has been generated) and various flags. sigaction() is more powerful function.
Just refer to the man
Just refer to the man page.
sigaction() is just a glorified version of signal() which provides finer control over the signal.
can you tell how it can
can you tell how it can offer finer control? thanks
try the man pages
You can even find them online: signal(2) and sigaction(2).
can you tell me what is tne
can you tell me what is tne meaning of the 2 in signal(2)?is there also signal(3)? what are the differences between them?
You should read up on Unix
You should read up on Unix man pages. They are broken up into numbered sections. Section 2 is about system calls. Read intro(2) for more information. Section 3 is about library functions. Again, read intro(3) for more information.
Note that at the bottom of each of these linked man pages there are links to other relevant man pages. At the bottom of the intro man pages, there are links to all other intro man pages. It sounds like it would be a good idea if you start by reading all of those.
The signal(2) man page also includes links to other relevant man pages.
what is the Section 1?
what is the Section 1?
man man
to get help about the help system
man, just go to your friendly command line and enterman man.Are you really this helpless or are you trying to be funny?
Thanks for the links
Thanks for the links
The main difference I think,
The main difference I think, is signal() is used to just install a new signal handler whereas sigaction() can do much more. sigaction() is passed a struct sa_sigaction which can have details like, the signal masks, signal info (eg. how it has been generated) and various flags. sigaction() is more powerful function.