title: Can I pass arguments to SIGINT?
body: <p>I am trying to pass some extra arguments so they can be used at the SIGINT call on my program, but I am getting a compile error, is this actually achievable or am I misinformed?</p>
  
  <p>If it is achievable, could someone please explain my mistake here;</p>
  
  <pre><code>void signal_handler(bool &amp;txMode, char* &amp;txData, int &amp;sendresult, int &amp;sockFD,_
  char* &amp;txBuffer, struct sockaddr_ll &amp;socket_address);
  
  int main(int argc, char *argv[]) {
      unsigned char sourceMAC[6];
      unsigned char destMAC[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
      bool txMode = true;
      char* txBuffer = (char*)operator new(ETH_FRAME_LEN);
      unsigned char* txEtherhead = (unsigned char*)txBuffer;
      struct ethhdr *eh = (struct ethhdr *)txEtherhead;
      int sockFD;
      char* txData = txBuffer + headersLength;
      struct sockaddr_ll socket_address;
      int sendresult = 0;
  
      signal (SIGINT,signal_handler(txMode, txData, sendresult, sockFD, txBuffer,_
      socket_address));
  
      return 0;
  }
  
  void signal_handler(bool &amp;txMode, char* &amp;txData, int &amp;sendresult, int &amp;sockFD,_
  char* &amp;txBuffer, struct sockaddr_ll &amp;socket_address) {
  
    if(txMode==true) {
      std::string param;
      std::stringstream ss;
      ss &lt;&lt; "etheratedeath";
      param = ss.str();
      strncpy(txData,param.c_str(), param.length());
      sendresult = sendto(sockFD, txBuffer, ETH_FRAME_LEN, 0, 
               (struct sockaddr*)&amp;socket_address, sizeof(socket_address));
    }
    cout &lt;&lt; "You killed me!" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I am getting the following error at compile time;</p>
  
  <pre><code>user@machine:~/c/ethernet1$ gcc -o ethernet1 ethernet1.cpp -lrt
  ethernet1.cpp: In function ‘int main(int, char**)’:
  ethernet1.cpp:358: error: invalid use of void expression
  </code></pre>
  
  <p>Which refers to this line in main();</p>
  
  <pre><code>signal (SIGINT,signal_handler(txMode, txData, sendresult, sockFD, txBuffer, socket_address));
  </code></pre>