title: Registering a callback function in C
body: <p>I am some Linux kernel space code. I want an application in user space to be able to register a callback function in the kernel space code by calling a function in the kernel space code and passing the address of that callback function. The kernel space code would then execute the callback function at a later time when running. I believe the kernel space code should look something like this:</p>
  
  <pre><code>typedef void (*callback_func) (void);
  callback_func callback;
  
  static void registerCallBack(callback_func funct){callback = funct;}
  
  //another kernel space method
  funct();
  </code></pre>
  
  <p>However, I am a little unsure on the proper typedef and if this will work properly. Can anyone confirm the functionality of this or offer any advice in this area? I am unable to test this right now as I am waiting on the rest of the kernel space code to be finished.</p>