/
githubmirror
/
strace
Обзор
Документация
Войти
/
githubmirror
/
strace
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/legacy_syscall_info.test
54 строки
2 KB
Dmitry V. Levin
Update copyright headers
10 фев 2026, 11:00
10 фев 2026, 11:00
8f8b9d4
Код
Авторство
О чём код?
#!/bin/sh -efu # # Check legacy code used for obtaining syscall number, arguments, # and return value when modern ptrace API was not available yet. # # Copyright (c) 2017-2021 Dmitry V. Levin <ldv@strace.io> # Copyright (c) 2021-2026 The strace developers. # All rights reserved. # # SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" # The legacy API is broken on riscv64 with kernel 6.11+ # The same change was also backported into the 6.6 stable tree # https://github.com/strace/strace/issues/315 [ "$(uname -m)" != "riscv64" ] || require_max_kernel_version_or_skip 6.6.49 check_prog grep $STRACE -d -enone / > /dev/null 2> "$LOG" ||: grep -x "[^:]*strace: PTRACE_GET_SYSCALL_INFO works" "$LOG" > /dev/null || skip_ 'PTRACE_GET_SYSCALL_INFO does not work' run_prog ../chdir > /dev/null helper='../../src/disable_ptrace_get_syscall_info' $helper $args > /dev/null || skip_ "$helper does not work" $helper $STRACE -d -enone / > /dev/null 2> "$LOG" ||: grep -x "[^:]*strace: PTRACE_GET_SYSCALL_INFO does not work" "$LOG" > /dev/null || fail_ "$helper does not work properly" > "$LOG" || fail_ "failed to write $LOG" set -- --trace=chdir -a10 $args $helper $STRACE -o "$LOG" "$@" > "$EXP" || dump_log_and_fail_with "$helper $STRACE $* failed with code $?" match_diff "$LOG" "$EXP" helper2='../../src/disable_ptrace_getregset' $helper2 $helper $args > /dev/null || exit 0 # the second part of the test is not applicable $helper2 $helper $STRACE -d -enone / > /dev/null 2> "$LOG" ||: grep -x "[^:]*strace: PTRACE_GET_SYSCALL_INFO does not work" "$LOG" > /dev/null || fail_ "$helper2 $helper does not work properly" > "$LOG" || fail_ "failed to write $LOG" $helper2 $helper $STRACE -o "$LOG" "$@" > "$EXP" || dump_log_and_fail_with "$helper2 $helper $STRACE $* failed with code $?" match_diff "$LOG" "$EXP"