(root)/
strace-6.5/
src/
linux/
aarch64/
set_scno.c
       1  /*
       2   * Copyright (c) 2016-2021 The strace developers.
       3   * All rights reserved.
       4   *
       5   * SPDX-License-Identifier: LGPL-2.1-or-later
       6   */
       7  
       8  #ifndef NT_ARM_SYSTEM_CALL
       9  # define NT_ARM_SYSTEM_CALL 0x404
      10  #endif
      11  /*
      12   * NT_ARM_SYSTEM_CALL regset is supported by linux kernel
      13   * starting with commit v3.19-rc1~59^2~16.
      14   */
      15  
      16  static int
      17  arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
      18  {
      19  	unsigned int n = (uint16_t) scno;
      20  	const struct iovec io = {
      21  		.iov_base = &n,
      22  		.iov_len = sizeof(n)
      23  	};
      24  	int rc = ptrace(PTRACE_SETREGSET, tcp->pid, NT_ARM_SYSTEM_CALL, &io);
      25  	if (rc && errno != ESRCH)
      26  		perror_func_msg("NT_ARM_SYSTEM_CALL pid:%d scno:%#x",
      27  				tcp->pid, n);
      28  	return rc;
      29  }