Thread: go to a particular area on receiving SIGUSR2

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    32

    go to a particular area on receiving SIGUSR2

    Hi

    I need to do something similar to this and am having problems on how should i do it.. I need that if a signal SIGUSR2 is generated while i'm inside the 'for loop' the 'for loop' starts again. The pseudocode for this is something like this:

    Code:
    //milestone A
    setting to catch SIGUSR2
    for (i=0;i<n;i++){
        if SIGUSR2 generated here go back to milestone A
    }
    Note i don't want to use recursion at all since there are some flags that are setted on leaving and anyway....

    Thanks

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Code:
    goto milestoneA;

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    32
    huh?

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    What? Don't you know how to use a goto? That's what you just asked how to do. Make a label. Goto it.


    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Registered User
    Join Date
    Apr 2007
    Posts
    32
    yeah ok thx

    But i need to signal catch and its not just as if saying if SIGUSR2 caught, + i think there should be some sort of setjmp and lngjump :s

  6. #6
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    eh? Re ask the question me thinks.

  7. #7
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by Cmaniac View Post
    yeah ok thx

    But i need to signal catch and its not just as if saying if SIGUSR2 caught, + i think there should be some sort of setjmp and lngjump :s
    Nope.

    Code:
    GoHere:
    
           <inside the loop>
           if (whatever you need to detect your SIGUSR2)
              goto GoHere;
    Adak

  8. #8
    Registered User
    Join Date
    Apr 2007
    Posts
    32
    ok thx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. area of a circle
    By wise_ron in forum C Programming
    Replies: 2
    Last Post: 10-02-2006, 03:15 PM
  2. very weird problem (pointers I think)
    By hannibar in forum C Programming
    Replies: 2
    Last Post: 10-11-2005, 06:45 AM
  3. What am I doing wrong? Help please...
    By SprinterSteve in forum C Programming
    Replies: 9
    Last Post: 04-17-2003, 09:35 PM
  4. Need help with switch
    By 3kgt in forum C Programming
    Replies: 2
    Last Post: 02-26-2003, 12:43 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM