Make guality.h handle Yama restricted ptrace mode
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 8 Jul 2019 06:21:05 +0000 (06:21 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 8 Jul 2019 06:21:05 +0000 (06:21 +0000)
commit0de175b8d6722cca2221bbb52772f975058ac183
treec83ee5e85562d1c1952d7a86d562ad7fa5808348
parent7ef004023510d0c88e1a8bb718ee2848c1358ea4
Make guality.h handle Yama restricted ptrace mode

guality.exp is silently skipped on Linux systems with
kernel.yama.ptrace_scope=1 because gdb fails to attach to the
sanity check test.  This patch uses PR_SET_PTRACER (where available)
to avoid this.

prctl was apparently added in Linux 2.1.57, so I don't think we
need any tests other than __linux for the #include.

2019-07-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
* gcc.dg/guality/guality.h: Include <sys/prctl.h> on Linux targets.
(main): Use PR_SET_PTRACER where available.

From-SVN: r273192
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/guality/guality.h