Some additional information:
# strace -e trace=file ./cordtest
...
openat(AT_FDCWD, "/proc/3702/clear_refs", O_WRONLY) = 3
...
SUCCEEDED
+++ exited with 0 +++
It is absolutely legal for the owner of a process to write to /proc/<pid>/clear_refs
I think it is a bug in Gentoo sandbox that this is not allowed.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 741 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 54:53:46 |
| Calls: | 12,446 |
| Calls today: | 1 |
| Files: | 15,192 |
| Messages: | 6,537,337 |