Thread: THe 'signal' function question

  1. #1
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020

    THe 'signal' function question

    Hi,

    I hav a question about the 'signal' function in the signal handling library. say i've got
    signal( SIGINT, signal_handler );
    But if the signal_handler function has a parameter. Like a prototype below
    void signal_handler( int signalValue );
    What will signalValue be if i report the signal using 'raise()' ?
    What will be passed to the signal handling function?

    thnx

  2. #2
    Registered User bljonk's Avatar
    Join Date
    Oct 2001
    Posts
    70
    it will return 0 if the raise was successfull, otherwise it will return 1 or -1.

    and the other question is out of my understanding. Sorry about it
    Ünicode¬>world = 10.0£

  3. #3
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    You havn'et answered my question yet. I only asked one.

    thnx, anybody else?

  4. #4
    The Artful Lurker Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633

    Re: THe 'signal' function question

    Originally posted by Nutshell
    What will signalValue be if i report the signal using 'raise()' ?
    What will be passed to the signal handling function?
    The numeric value of the signal raised. For example SIGINT == 2 and SIGKILL == 9. You can get a complete listing in the header file /usr/include/signal.h
    Jason Deckard

  5. #5
    Unregistered
    Guest
    Whatever the value of the SIGINT is. Assuming, of course, that you call raise() like this:

    raise(SIGINT);

    The numeric value of SIGINT is implementation-defined so it needn't be the same on all systems. The only requirements are that it be a positive number. A common value is 2.

  6. #6
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    yep thnx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CreateThread() function question
    By chiefmonkey in forum C++ Programming
    Replies: 5
    Last Post: 05-15-2009, 07:52 AM
  2. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  3. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  4. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  5. I need help with passing pointers in function calls
    By vien_mti in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 10:00 AM