crashpad::ScopedPrSetPtracer Class Reference

## Public Member Functions

| ScopedPrSetPtracer (pid_t pid, bool may_log)
| Uses `PR_SET_PTRACER` to set pid as the caller's ptracer. More...

## Constructor & Destructor Documentation

## ScopedPrSetPtracer()

crashpad::ScopedPrSetPtracer::ScopedPrSetPtracer | ( | pid_t | pid,
|  | bool | may_log
| ) |  |

Uses `PR_SET_PTRACER` to set pid as the caller's ptracer.

`PR_SET_PTRACER` is only supported if the Yama Linux security module (LSM) is enabled. Otherwise, `prctl(PR_SET_PTRACER, ...)` fails with `EINVAL`. See linux-4.9.20/security/yama/yama_lsm.c yama_task_prctl() and linux-4.9.20/kernel/sys.c [sys_]prctl().

An error message will be logged on failure only if may_log is `true` and `prctl` does not fail with `EINVAL`;

Parameters

  [in] | pid | The process ID of the process to make the caller's ptracer.
  [in] | may_log | if `true`, this class may log error messages.

The documentation for this class was generated from the following files:

- util/linux/scoped_pr_set_ptracer.h
- util/linux/scoped_pr_set_ptracer.cc