Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp597084ybn; Wed, 25 Sep 2019 04:58:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD+WQZh7yWqHXREJOehomKoeoDrAu5bRMwwqPV4KIiin5rrz1KSXemZop03ra5bppKOdlc X-Received: by 2002:a1c:968b:: with SMTP id y133mr7176757wmd.56.1569412701334; Wed, 25 Sep 2019 04:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569412701; cv=none; d=google.com; s=arc-20160816; b=FdEi7RBltnhC9j6BiKmfoeo+pAPks+rj6AC417ZD2g7wlBR1mPXsHPEwBFwaCUlZp6 Dd7korCn5sZXrgqi2dSc/W+IJBvaE8u2nddxLy86erfjzZ7Ocpacmg8s9khq09/L4QEM YFoxSvJecKPzhsIIN2CYwPeJaMcyMwQ5gZCnBJiGh1nCHPjjBf8A12PkUERAjJL4C4m0 zUgpk7Vw/GBDWHO7HuuHa3nqXs/xVP7n/6rlHaXV8pXm7TWjvKDSqfoNhXR0I0SHNFde eYGbloMec/89deNuZVJMNwW0g5KJ4VskRL0VNJcpXMpPMKiYZv292Z7A4DA/b2Z41nXH K4lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=IFdwQB/ijINnA/lqlmbhpdAwR/YqjJgUmIEdCY57TRQ=; b=cacCf1was8F7zp0y9e/8V7EWZSm9TkMsKTVdHNRO7CSXfggwlP9w53sMYCynEkfPKz QHZNJ7lF8LsbrsQY3QpEIIqt6rdB+gKPTY2qrEreelN6eJCv03L4f6GrHu4cme9P4Mby WuF+imf82Dteigrt9AWbxIkuFNDwNXrKjEd69T4JsZfPQKl1Wbg1nmbi/dHUmfuvHxM2 woxh2bnfyuWuuJYD9/zWaG3nYB8s2ZXjzP7NlTvn4pErMIJ+PBHKHHeYtO4d2NnzEP4/ LiZ7yunruaF/F3FxxHtkjoV8fgokNo13OaaG/5jmUYM6Xx0swjAvnho/KEKGnZDjbOzy n0GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AtZVa39H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ox28si2442506ejb.130.2019.09.25.04.57.44; Wed, 25 Sep 2019 04:58:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AtZVa39H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393759AbfIWL0q (ORCPT + 99 others); Mon, 23 Sep 2019 07:26:46 -0400 Received: from mail-ua1-f46.google.com ([209.85.222.46]:38470 "EHLO mail-ua1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387657AbfIWL0q (ORCPT ); Mon, 23 Sep 2019 07:26:46 -0400 Received: by mail-ua1-f46.google.com with SMTP id 107so4202605uau.5 for ; Mon, 23 Sep 2019 04:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=IFdwQB/ijINnA/lqlmbhpdAwR/YqjJgUmIEdCY57TRQ=; b=AtZVa39H3Xtur7smzRZSAgg07PxhyIHQVN8+CyVQrPEfTRLQEjLrIILub5Zeges/nQ 3uKUFiBL6SNW03v7RKQRUyjDFM4NQ7hwCfPxMjNnbd1tnO7xfv8q2vD+zqWJL2TJmQgR MJOsQrsW7jzTSpquLrFphFxPYbxXa49l4dH8AzlsLTRtH9pCPVWf26vbcAnfDp3rSreB siqCdt34IVlVlUf+86Jw8igtQUZRzUQs8IcpTas2POshYHB93fvq5jYZFTzKKgaTifxh m6BMxWWuGuFgcUcCWjD4RJSglFyv1BIJ9FPuKnZ37ihhKP5O+IDkHtYuOpdh3uPotaWE el6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=IFdwQB/ijINnA/lqlmbhpdAwR/YqjJgUmIEdCY57TRQ=; b=fVlkfiY4JALNznOCDJjYvmzI8E3GUW8vaZeUD18dLFDm0s1fKjrMhmWKp4D8FG8B9U BSFpks1YelN3I3GeIvBSkYeNOiOrjDtqiySVWMl7qQDMoXmUpejxcARNkoeyyPWKrTwU JEZCG6Ou3E6yr70BT5YyBjdX/vqyA6+epAc6A5ElYTSt/+8BgXq2a7eXNWYMGJMYYt5F VSfGJTdGzHq3Pk2RNwZhmm+YvDTgwOgjB0rPvTpmMMI1XYLKTVB/1NEW0LIUJswXoC5S xYi+FTbiasVJJjtqN/UM9vy2nYGMTvI4TiiOWY1trp6wOgZHX0UEjwxM4P3xUdRgjCKy 7uew== X-Gm-Message-State: APjAAAVOkq3D7eB28f1P2YDcz8yF4jhiwvOlYGMp8vtu35pL8SECpStp rypasqpalWqtbbov8Td2MOwa4pwnT+fwdHAnqk4tDQ== X-Received: by 2002:ab0:748a:: with SMTP id n10mr15884519uap.41.1569238003126; Mon, 23 Sep 2019 04:26:43 -0700 (PDT) MIME-Version: 1.0 References: <90399dee-53d8-a82c-3871-9ec8f94601ce@gmail.com> <87tv939td6.fsf@mid.deneb.enyo.de> In-Reply-To: <87tv939td6.fsf@mid.deneb.enyo.de> From: Daniel Colascione Date: Mon, 23 Sep 2019 04:26:07 -0700 Message-ID: Subject: Re: For review: pidfd_open(2) manual page To: Florian Weimer Cc: "Michael Kerrisk (man-pages)" , Christian Brauner , Jann Horn , "Eric W. Biederman" , Joel Fernandes , Linux API , lkml , linux-man , Oleg Nesterov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 23, 2019 at 3:53 AM Florian Weimer wrote: > > * Michael Kerrisk: > > > SYNOPSIS > > int pidfd_open(pid_t pid, unsigned int flags); > > Should this mention for pid_t? > > > ERRORS > > EINVAL flags is not 0. > > > > EINVAL pid is not valid. > > > > ESRCH The process specified by pid does not exist. > > Presumably, EMFILE and ENFILE are also possible errors, and so is > ENOMEM. > > > A PID file descriptor can be monitored using poll(2), select(2= ), > > and epoll(7). When the process that it refers to terminates, t= he > > file descriptor indicates as readable. The phrase "becomes readable" is simpler than "indicates as readable" and conveys the same meaning. I agree with Florian's comment on this point below. > > Note, however, that in the > > current implementation, nothing can be read from the file descri= p=E2=80=90 > > tor. > > =E2=80=9Cis indicated as readable=E2=80=9D or =E2=80=9Cbecomes readable= =E2=80=9D? Will reading block? > > > The pidfd_open() system call is the preferred way of obtaining= a > > PID file descriptor. The alternative is to obtain a file descri= p=E2=80=90 > > tor by opening a /proc/[pid] directory. However, the latter tec= h=E2=80=90 > > nique is possible only if the proc(5) file system is mounted; fu= r=E2=80=90 > > thermore, the file descriptor obtained in this way is not po= l=E2=80=90 > > lable. Referring to procfs directory FDs as pidfds will probably confuse people. I'd just omit this paragraph. > One question is whether the glibc wrapper should fall back back to the > /proc subdirectory if it is not available. Probably not. I'd prefer that glibc not provide this kind of fallback. posix_fallocate-style emulation is, IMHO, too surprising.