Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

20. Signals: Fundamental Concepts > Changing Signal Dispositions: signal()

Changing Signal Dispositions: signal()

UNIX systems provide two ways of changing the disposition of a signal: signal() and sigaction(). The signal() system call, which is described in this section, was the original API for setting the disposition of a signal, and it provides a simpler interface than sigaction(). On the other hand, sigaction() provides functionality that is not available with signal(). Furthermore, there are variations in the behavior of signal() across UNIX implementations (Implementation and Portability of signal() ), which mean that it should never be used for establishing signal handlers in portable programs. Because of these portability issues, sigaction() is the (strongly) preferred API for establishing a signal handler. After we explain the use of sigaction() in Changing Signal Dispositions: sigaction() , we’ll always employ that call when establishing signal handlers in our example programs.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint