[CRIU] Re: [PATCH] ptrace: add ability to get clear_tid_address

Pavel Emelyanov xemul at parallels.com
Thu Feb 2 08:20:40 EST 2012


On 02/02/2012 02:08 PM, Andrew Vagin wrote:
> We need this address for dumping and restoring processes.

Most likely people will want this as prctl extension.

> Signe-off-by: Andrew Vagin <avagin at openvz.org>
> ---
>  include/linux/ptrace.h |    1 +
>  kernel/ptrace.c        |    3 +++
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
> index c2f1f6a..28fadfa 100644
> --- a/include/linux/ptrace.h
> +++ b/include/linux/ptrace.h
> @@ -50,6 +50,7 @@
>  #define PTRACE_SEIZE		0x4206
>  #define PTRACE_INTERRUPT	0x4207
>  #define PTRACE_LISTEN		0x4208
> +#define PTRACE_GET_TID_ADDRESS  0x4209
>  
>  /* flags in @data for PTRACE_SEIZE */
>  #define PTRACE_SEIZE_DEVEL	0x80000000 /* temp flag for development */
> diff --git a/kernel/ptrace.c b/kernel/ptrace.c
> index 00ab2ca..ed7fbe7 100644
> --- a/kernel/ptrace.c
> +++ b/kernel/ptrace.c
> @@ -845,6 +845,9 @@ int ptrace_request(struct task_struct *child, long request,
>  		break;
>  	}
>  #endif
> +	case PTRACE_GET_TID_ADDRESS:
> +		return put_user(child->clear_child_tid, (int __user **) data);
> +
>  	default:
>  		break;
>  	}



More information about the CRIU mailing list