Thread: On signals

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    48
    Rep Power
    2

    On signals


    I've read many tutorials both good and bad about C but only one contained a sigle page on signals and how they work etc.
    I want to better understand them and the referance manual for the availible functions from glibc is not a good place to learn.
    Does anyone else know some good free resources out there?
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    What exactly are you looking for here? Are the man pages not detailed enough? On Ubuntu Linux, if you run:
    man 2 signal
    man 7 signal

    You get fairly comprehensive docs on how the function works, a list of different signal types, a list of safe functions that can be used in a signal handler, what to return from your signal handler etc. from those two manual pages. Is there any particular piece of information you're looking for?
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,162
    Rep Power
    2222
    The subject of signals and signal handling is usually covered in Linux/UNIX system programming. Or in shell scripting, which would at least offer a perspective on the subject, albeit not a C perspective.

    Some years ago I downloaded a book, Advanced Linux Programming, for free. It might still be out there.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    48
    Rep Power
    2
    Originally Posted by dwise1_aol
    Some years ago I downloaded a book, Advanced Linux Programming, for free. It might still be out there.
    Found it thanks!

    I'm talking about how to determine if you should block a signal or handle it or what. This might seem like a basic thing but some library functions like fopen return EINTR if a signal is received during it's execution. Their are other library functions that also return EINTR if a signal is received during execution I don't know all of them.
    Here's my source for this info:

    http://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html#Interrupted-Primitives
  8. #5
  9. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,855
    Rep Power
    481
    I accidentally discovered that if you send sigusr1 to fluent it finishes the current iteration, saves the results and continuation files, then returns control to the user.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo