Re: Checking for support of ptrace(PTRACE_SEIZE,...) on older kernels

From: Alejandro Colomar
Date: Mon Apr 17 2023 - 14:47:04 EST


Hi Oleg,

On 4/17/23 13:50, Oleg Nesterov wrote:
> Well, from https://man7.org/linux/man-pages/man2/ptrace.2.html
>
> ESRCH The specified process does not exist, or is not currently
> being traced by the caller, or is not stopped (for
> requests that require a stopped tracee).
>
> so if the kernel doesn't support PTRACE_SEIZE then ptrace(PTRACE_SEIZE)
> should fail with -ESRCH as documented.
>
> Perhaps this part
>
> EIO request is invalid, or ...
>
> can be improvef a bit to explain that this happens if the target is already
> traced by us and stopped.

I'm not sure if it's necessary. When several errors happen at the same time,
there's usually no documentation about which takes precedence, with few
exceptions. Knowing it's intentional, I'm content.

Thanks,

Alex

--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

Attachment: OpenPGP_signature
Description: OpenPGP digital signature