title: execv call in C
body: <p>There is a simple program below that takes a  HUP and continues with execv. The problem is when the execv call is executed, after that the code continues from the places where the HUP comes.I want, after execv the code must exit from main and than start again from the beginning of main.  </p>
  
  <pre><code>char* a;
  char** args;
  
  void hup_func(){
      printf("aaaa\n");
      if(execv(a,args))
          printf("bbb\n");
  }
  
  int main(int argc,char* argv[]){
      signal(SIGHUP,hup_func);
      args=argv;
      a=args[0];
      printf("%s\n",a);
      while(1){
          printf("test\n");
          sleep(10);
       }
  
     return 0;
  }
  </code></pre>
  
  <p>The name of the program is deneme1. The output of the code is when I sent HUP;</p>
  
  <pre><code>./deneme1
  test
  test
  aaa 
  bbbb
  test.
  </code></pre>
  
  <p>But I want it, when I sent HUP, it must start with the start of the main. like that</p>
  
  <pre><code>./deneme1
  test
  test
  aaa
  bbb
  ./deneme1
  test
  ...
  </code></pre>
  
  <p>I want it to return at the beginning of the main after HUP, not the place where it was before</p>