# Re: \[PATCH v2 0/5\] pid: add pidfd\_open()

- From: Linus Torvalds \<torvalds@linux-foundation.org\>
- Date: 2019-03-30 16:17:10 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2019/03/5555630
- Thread: https://ratatoskr.run/linux-api/2019/03/5554749/t.md

```text
On Sat, Mar 30, 2019 at 9:11 AM Daniel Colascione [ref] wrote:
>
> How do you propose that someone open the /proc/<pid>/status file in a
> race-free manner starting with the result of calling pidfd_open?

CXhrist.

If you want to open a /proc file, then open a /proc file. Don't use
pidfd_open().

Just open /proc/<pid>/

Then you can use openat() to open whatever sub-files you want.

You have two choices: either you use /proc, or you don't. Don't mix the two.

And no, we are *NOT* making pidfd_open() into some "let's expose /proc
even when it's not mounted" horror. Seriously. That's disgusting,
wrong, insecure and stupid.

                           Linus
```
