1dnl SPDX-License-Identifier: GPL-2.0-or-later
2dnl Copyright (c) Jiri Palecek 2009
3
4AC_DEFUN([LTP_CHECK_LINUX_PTRACE],
5_LTP_CHECK_LINUX_PTRACE
6)
7
8dnl Check for ptrace support
9dnl in commit 016ae219 in July 2008
10AC_DEFUN([_LTP_CHECK_LINUX_PTRACE],[
11dnl order of headers checked here is significant
12AC_CHECK_HEADERS([ \
13	sys/ptrace.h \
14	sys/reg.h \
15	asm/ptrace.h \
16	linux/ptrace.h \
17])
18save_CPPFLAGS=$CPPFLAGS
19CPPFLAGS="$CPPFLAGS -I$srcdir/testcases/kernel/syscalls/ptrace"
20AC_CHECK_TYPES([struct user_regs_struct, struct pt_regs],,,[#include "ptrace.h"])
21AC_CHECK_DECLS([PTRACE_GETSIGINFO, PTRACE_O_TRACEVFORKDONE, PTRACE_SETOPTIONS],,,[#include "ptrace.h"])
22dnl glibc-2.18 defines ptrace_peeksiginfo_args in sys/ptrace.h which
23dnl conflicts with the one from linux kernel in linux/ptrace.h
24AC_CHECK_TYPES([struct ptrace_peeksiginfo_args],,,[#include <sys/ptrace.h>])
25CPPFLAGS=$save_CPPFLAGS
26])
27