title: ERESTART_RESTARTBLOCK and restart_syscall confusion
body: <p>It would appear from the source of <code>nanosleep()</code> in <code>kernel/time/hrtimer.c</code> and the manpage of <code>restart_syscall()</code> that to enable <code>nanosleep()</code> to be restarted with the correct timeout after a signal, it saves some state into <code>current_thread_info()-&gt;restart_block</code>, returns <code>ERESTART_RESTARTBLOCK</code> and that the signal delivery code would arrange for <code>restart_syscall()</code> to be called after the signal handler returns to do this. However:</p>
  
  <ul>
  <li>There is only space in <code>current_thread_info()-&gt;restart_block</code> for one syscall, so what happens in case of recursive signals?</li>
  <li>The ARM and x86 signal delivery code resets <code>current_thread_info()-&gt;restart_block</code> before a signal handler is called.</li>
  <li>The ARM signal delivery code does not arrange for <code>restart_syscall()</code> to be called, instead it sets the return code to <code>-EINTR</code>.</li>
  </ul>
  
  <p>Where is my mistake in the purpose or functioning of this code?</p>