OL> +int cr_retval_restart(struct cr_ctx *ctx)
OL> +{
OL> +   struct pt_regs *regs = task_pt_regs(current);
OL> +   int ret = 0;
OL> +
OL> +   /*
OL> +    * The retval should be either zero if the checkpointed task
OL> +    * had been in user-space when frozen, or the retval from the
OL> +    * syscall that had been interrupted then.
OL> +    *
OL> +    * In the latter, if the syscall succeeded (perhaps partially)
OL> +    * then the retval is non-negative. If it failed, the error
OL> +    * may be one of -ERESTART... gang, interpreted in the signal
OL> +    * handling code. In restart it must happen, too.
OL> +    *
OL> +    * To force execution of the signal handler now, too, we fake
OL> +    * a signal to ourselves (a la freeze/thaw) when ret < 0.
OL> +    */
OL> +
OL> +   /* were we from a system call?  if so, get old error/retval */
OL> +   if (syscall_get_nr(current, regs) >= 0)
OL> +           ret = syscall_get_error(current, regs);
OL> +   /* old error ?  if so, make sure signal handling kicks in */
OL> +   if (ret < 0)
OL> +           set_tsk_thread_flag(current, TIF_SIGPENDING);
OL> +   return ret;
OL> +}

Does this need to be arch-specific?  At first glance, I can't think of
anything I'd need to change for s390, for example.

-- 
Dan Smith
IBM Linux Technology Center
email: [email protected]

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to