Thread (82 messages) flat view 82 messages, 12 authors, 2019-04-01

Re: [PATCH v2 0/5] pid: add pidfd_open()

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2019-03-31 21:26:10
Also in: lkml

On Sun, Mar 31, 2019 at 2:10 PM Christian Brauner [off-list ref] wrote:
I don't think that we want or can make them equivalent since that would
mean we depend on procfs.
Sure we can.

If /proc is enabled, then you always do that dance YOU ALREADY WROTE
THE CODE FOR to do the stupid ioctl.

And if /procfs isn't enabled, then you don't do that.

Ta-daa. Done. No stupid ioctl, and now /proc and pidfd_open() return
the same damn thing.

And guess what? If /proc isn't enabled, then obviously pidfd_open()
gives you the /proc-less thing, but at least there is no crazy "two
different file descriptors for the same thing" situation, because then
the /proc one doesn't exist.

Notice? No incompatibility. No crazy stupid new "convert one to the
other", because "the other model" NEVER EXISTS. There is only one
pidfd - it might be proc-less if CONFIG_PROC isn't there, but let's
face it, nobody even cares, because nobody ever disabled /proc anyway.

And no need for some new "convert" interface (ioctl or other).

Problem solved.

                   Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help