You might want to look at how ptrace
and process_vm_readv
checks on Linux then. Apart from the euid
check, depending on the system setting, these two syscall additionally requires the caller process to be an ancestor of the target.
If you don’t like this centralized vm_remap
-style API, then might it be better if I implemented process_vm_readv
, FreeBSD mremap
and a custom commit_memory
instead?