Thread: Question about signals

  1. #1
    Registered User
    Join Date
    Jan 2006
    Location
    Berkeley, Ca
    Posts
    195

    Question about signals

    In the book "Advanced Programming in the Unix Environment", 2nd edition, at the end of page 313:


    "The only time pause returns is if a signal handler is executed and that handler returns. In that case, pause returns -1 with errno set to EINTR."

    Is the signal handler and handler the same thing? Also, does the
    handler return when it encounters something like SIG_ERR? The reason I ask this is because both figure 10.2 *on page 300 and figure 10.7 on page 314 seem to suggest this.


    Thanks in advance
    Chad

  2. #2
    ex-DECcie
    Join Date
    Dec 2005
    Posts
    125
    Quote Originally Posted by cdalten
    In the book "Advanced Programming in the Unix Environment", 2nd edition, at the end of page 313:


    "The only time pause returns is if a signal handler is executed and that handler returns. In that case, pause returns -1 with errno set to EINTR."

    Is the signal handler and handler the same thing? Also, does the
    handler return when it encounters something like SIG_ERR? The reason I ask this is because both figure 10.2 *on page 300 and figure 10.7 on page 314 seem to suggest this.


    Thanks in advance
    Chad

    If that's the book by Stevens, it is excellent, if a bit dated now. My copy is at home, right now.

    To answer the first question, I'd say yes, it's the same handler.

    I'd need to look at the book to try and answer your second question.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The handler returns whenever it does not call exit() or abort() or a similar function.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User
    Join Date
    Jan 2006
    Location
    Berkeley, Ca
    Posts
    195
    I have the second edition of "Advanced Programming in the Unix Environment" by W Richard Stevens and Stephen A. Rago. The book is a trip to read.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM