Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp584257ybn; Wed, 25 Sep 2019 04:43:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqytSZ5jsaZCI1NDMf4rHwSQFdvArrux0qOgxwLNfhEeNrPkxR+u2JSVsqsoUl3EFPT8FQAj X-Received: by 2002:adf:f011:: with SMTP id j17mr9240627wro.131.1569411839569; Wed, 25 Sep 2019 04:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569411839; cv=none; d=google.com; s=arc-20160816; b=Ud/tZLpYmL6HOevxiDHjMN+CfcQitbppYuGWN3xfehw3mH6+B1q812yL0tO4XV8g5l qbGb33zoNrn1KJlpwPXuKhws0oeLqgEVd7f8v4R5QWcxyzBiQA56P2uEI9Ka4YwyBqw6 11zb+UZlrBU/Mu+3bSBbL2N0Rkc5VMFWJwt341G5/TM7xDdsqpg1SOyGMluxWx+RP02e noyPIUItfuFT6qbDBW22621k6bZTx1mi3hdtSiI+AOkTg5tNx+z35AhV4m/7IuQCc1P8 ivWHlN6l+Ig1pmbj5rfSOSkOsbFCXeOdulaOHTXPd1ErXBQGG4LovF5FJn4RYUMUorUY b4QA== 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:mime-version :message-id:in-reply-to:date:references:subject:cc:to:from; bh=CDSOl3JFMLoWezWEABp4cHK/7WUBS54xxDRDbhnmbLw=; b=CkTegmxYG06h92NxW8WUBQJXFW+2nA+Y5yNZPYWHhD1QcKw1HX2D2oWKFsBneY4kTi v+7IwOfROVT9bsW4CPxQFtWue7rhTkuYdrZolVKTniUGVnP1m9NcCYLlfachypEIZEEm 6puiGYbRp/xHJWmwBMuewKg5NKeNSEVDFsCmJPuRaz31L0kEnsNzce6g4wRSOMgKihTm 14iDDZ+Nz9WOxCg2Ze66atoDmRRDdx7cTdHJT1FPH5ViVyfGi/J7bxFZW+Is/arUjcIV Mxq2+rK9HKlyCv1BthP/BzlT5q8+kEqQ1m85zz8LUGzlK/Dyling0AYKq+6xcUsC2umc Xpig== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si2456200ejz.284.2019.09.25.04.43.34; Wed, 25 Sep 2019 04:43:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387435AbfIWLA7 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Sep 2019 07:00:59 -0400 Received: from mailout.enyo.de ([116.203.30.208]:47613 "EHLO mailout.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727273AbfIWLA6 (ORCPT ); Mon, 23 Sep 2019 07:00:58 -0400 X-Greylist: delayed 460 seconds by postgrey-1.27 at vger.kernel.org; Mon, 23 Sep 2019 07:00:57 EDT Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1iCLxt-0007C5-AJ; Mon, 23 Sep 2019 10:53:09 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1iCLxt-0001IF-7K; Mon, 23 Sep 2019 12:53:09 +0200 From: Florian Weimer To: "Michael Kerrisk \(man-pages\)" Cc: Christian Brauner , Jann Horn , Daniel Colascione , "Eric W. Biederman" , Joel Fernandes , Linux API , lkml , linux-man , Oleg Nesterov Subject: Re: For review: pidfd_open(2) manual page References: <90399dee-53d8-a82c-3871-9ec8f94601ce@gmail.com> Date: Mon, 23 Sep 2019 12:53:09 +0200 In-Reply-To: <90399dee-53d8-a82c-3871-9ec8f94601ce@gmail.com> (Michael Kerrisk's message of "Mon, 23 Sep 2019 11:11:53 +0200") Message-ID: <87tv939td6.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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, the > file descriptor indicates as readable. Note, however, that in the > current implementation, nothing can be read from the file descrip‐ > tor. “is indicated as readable” or “becomes readable”? 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 descrip‐ > tor by opening a /proc/[pid] directory. However, the latter tech‐ > nique is possible only if the proc(5) file system is mounted; fur‐ > thermore, the file descriptor obtained in this way is not pol‐ > lable. One question is whether the glibc wrapper should fall back back to the /proc subdirectory if it is not available. Probably not. > static > int pidfd_open(pid_t pid, unsigned int flags) > { > return syscall(__NR_pidfd_open, pid, flags); > } Please call this function something else (not pidfd_open), so that the example continues to work if glibc provides the system call wrapper.