The check is going to be used by another test soon.
* tests/PTRACE_SEIZE.sh: New file.
* tests/detach-stopped.test: Use it.
* tests/Makefile.am (EXTRA_DIST): Add PTRACE_SEIZE.sh.
EXTRA_DIST = \
COPYING \
GPL-2.0-or-later \
+ PTRACE_SEIZE.sh \
accept_compat.h \
attach-p-cmd.h \
caps-abbrev.awk \
--- /dev/null
+#!/bin/sh
+#
+# Skip the test if PTRACE_SEIZE is not supported.
+#
+# Copyright (c) 2014-2019 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+$STRACE -d -enone / > /dev/null 2> "$LOG" ||:
+if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
+ skip_ "PTRACE_SEIZE doesn't work"
+fi
# SPDX-License-Identifier: GPL-2.0-or-later
. "${srcdir=.}/init.sh"
+. "${srcdir=.}/PTRACE_SEIZE.sh"
run_prog_skip_if_failed \
kill -0 $$
-$STRACE -d -enone / > /dev/null 2> "$LOG"
-if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then
- skip_ "PTRACE_SEIZE doesn't work"
-fi
-
check_prog sleep
trap - TERM