[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-api
Subject:    Re: [PATCH 1/2] ptrace: add ability to retrieve signals without removing from a queue (v3)
From:       Oleg Nesterov <oleg () redhat ! com>
Date:       2013-02-27 18:38:50
Message-ID: 20130227183850.GA6042 () redhat ! com
[Download RAW message or body]

On 02/27, Andrey Vagin wrote:
>
> +struct ptrace_peeksiginfo_args {
> +	__u64 off;	/* from which siginfo to start */

Cough... You are optimist. You want to handle the case when the
tracee has 1 << 33 or more pending sigqueues. OK good luck ;)

Looks correct, just one nit.

> +	for (i = 0; i < arg.nr; i++) {
> ...
> +		data += sizeof(siginfo_t);
> +
> +		if (signal_pending(current)) {
> +			i++; /* accounting the current siginfo */
> +			break;
> +		}

Imho, this is confusing. Just do

	for (i = 0; i < arg.nr; ) {
		...

		data += sizeof(siginfo_t);
		i++;

		if (signal_pending(current))
			break;

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic