# Re: \[PATCH v2 6/7\] ptrace: introduce PTRACE\_SET\_SYSCALL\_INFO request

- From: Oleg Nesterov \<oleg@redhat.com\>
- Date: 2025-01-15 19:10:41 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2025/01/2891886
- Thread: https://ratatoskr.run/linux-api/2025/01/2888183/t.md

```text
On 01/15, Dmitry V. Levin wrote:
>
> On Wed, Jan 15, 2025 at 05:38:09PM +0100, Oleg Nesterov wrote:
> >
> > But may be
> >
> > 	if (syscall_get_nr() != -1)
> > 		syscall_set_arguments(...);
> >
> > will look a bit more consistent?
>
> I'm sorry, but I didn't follow.  As we've just set the syscall number with
> syscall_set_nr(), why would we want to call syscall_get_nr() right after
> that to obtain the syscall number?

Mostly for grep. We have more syscall_get_nr() != -1 checks. Even right after
syscall_set_nr-like code, see putreg32().

I think this needs another helper (which can have more users) and some cleanups.

But this is another issue, so please forget. I agree that syscall_get_nr() in
this code will probably just add the unnecessary confusion.

Oleg.

```
