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: | 715 |
| Nodes: | 16 (3 / 13) |
| Uptime: | 142:33:58 |
| Calls: | 12,089 |
| Calls today: | 2 |
| Files: | 14,998 |
| Messages: | 6,517,452 |