signal & sigaction

Submitted by zhn636
on September 13, 2007 - 1:08am

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?

Just refer to the man

Anonymous (not verified)
on
September 13, 2007 - 2:08am

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

zhn636
on
September 13, 2007 - 2:22am

can you tell how it can offer finer control? thanks

try the man pages

Anonymous (not verified)
on
September 13, 2007 - 6:19am

You can even find them online: signal(2) and sigaction(2).

can you tell me what is tne

zhn636
on
September 13, 2007 - 7:51pm

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

Anonymous (not verified)
on
September 13, 2007 - 8:04pm

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?

zhn636
on
September 14, 2007 - 2:39am

what is the Section 1?

man man

strcmp
on
September 14, 2007 - 4:13am

to get help about the help system man, just go to your friendly command line and enter man man.

Are you really this helpless or are you trying to be funny?

Thanks for the links

saulovacerat@dr...
on
March 21, 2008 - 11:28am

Thanks for the links

The main difference I think,

Anonymous (not verified)
on
September 13, 2007 - 7:06am

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.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.