lkml.org 
[lkml]   [2019]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2 0/5] pid: add pidfd_open()
    On Sat, Mar 30, 2019 at 10:12 AM Christian Brauner <christian@brauner.io> wrote:
    >
    >
    > To clarify, what the Android guys really wanted to be part of the api is
    > a way to get race-free access to metadata associated with a given pidfd.
    > And the idea was that *if and only if procfs is mounted* you could do:
    >
    > int pidfd = pidfd_open(1234, 0);
    >
    > int procfd = open("/proc", O_RDONLY | O_CLOEXEC);
    > int procpidfd = ioctl(pidfd, PIDFD_TO_PROCFD, procfd);

    And my claim is that this is three system calls - one of them very
    hacky - to just do

    int pidfd = open("/proc/%d", O_PATH);

    and you're done. It acts as the pidfd _and_ the way to get the
    associated status files etc.

    So there is absolutely zero advantage to going through pidfd_open().

    No. No. No.

    So the *only* reason for "pidfd_open()" is if you don't have /proc in
    the first place. In which case the whole PIDFD_TO_PROCFD is bogus.

    Yeah, yeah, if you want to avoid going through the pathname
    translation, that's one thing, but if that's your aim, then you again
    should also just admit that PIDFD_TO_PROCFD is disgusting and wrong,
    and you're basically saying "ok, I'm not going to do /proc at all".

    So I'm ok with the whole "simpler, faster, no-proc pidfd", but then it
    really has to be *SIMPLER* and *NO PROCFS*.

    PIDFD_TO_PROCFD violates *everything*.

    Linus

    \
     
     \ /
      Last update: 2019-03-30 18:24    [W:4.066 / U:0.432 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site