Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp639249pxa; Tue, 11 Aug 2020 11:14:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVnshPWQhEoH60eUvuNiI4fQ1VlAE4I7wSw488EXSCQppsNudS2Ux1zKLaeffFGwthZ8jX X-Received: by 2002:a17:906:1cd3:: with SMTP id i19mr12573276ejh.552.1597169651245; Tue, 11 Aug 2020 11:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597169651; cv=none; d=google.com; s=arc-20160816; b=DYvYx1c+l3/1pHKkkzajMw4b+7XOVKDDZEI9dacPYlu2uXHxU3GopOQuhwoz6mvu1v dAGf1aAM61JLlvdSE047WD9ymuZDHQvIv+vmxj/Vtfo7HLZauk8EZSPOmnzsoztu+y30 +Ovicfezj7nFGUPu4FNd+YdUhWr0tzFwk5wh7flhyTJfVmI6wxOGXsAmDSkB58OqfGUO agelLKcGTABwd7NseweiKCm6n0fB7ooE/+uBUJSQg32msQJF/35gxPkZVm+unkcU409S 0l+ZtPiIdnUmt3LVU9m4BxnJhpwWfNsKAcOG8AlHyfYwdtpKVUubd/8P6eZRzVA/ybzR hKcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=PNY0nTAugjdZ4zh8NnS67WxdAGaM8pwKmQIKtfgLsgg=; b=hNA4KpcEdD0BjsgYOTAWcUWcBJryQytBsTXuJa3Yo+jalJBsNkWFgtrynskP3GhOYB /5EK2AnHTyg69xs/yr12kX1JR9hMqwB3JSUoLnKzc7bbkzafbAlH72JvocWDV3LalJHh 92oCVMLVUFsK8F1NA5BVDZGUGpQEzeTmYuG0+xCq6/LXkSfTiCA/b4rPLr1d9fxUP1pm jiaMWAzaQ9UX5DCFVuoDjHMe5zxcdnl+rdr/JrPm6FkS2iFPJyxyA3zshPtVqGp/LsQZ AJATtnFyCgDq4y/3VMtuQdIajYse01ESF4x0MbyM0IawcW1oPiPUIl8AwkPLtqLW+yB0 DvNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si9068838ejk.222.2020.08.11.11.13.47; Tue, 11 Aug 2020 11:14:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726085AbgHKSMp (ORCPT + 99 others); Tue, 11 Aug 2020 14:12:45 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:53401 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbgHKSMo (ORCPT ); Tue, 11 Aug 2020 14:12:44 -0400 X-Originating-IP: 50.39.163.217 Received: from localhost (50-39-163-217.bvtn.or.frontiernet.net [50.39.163.217]) (Authenticated sender: josh@joshtriplett.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id C79A1C0006; Tue, 11 Aug 2020 18:12:39 +0000 (UTC) Date: Tue, 11 Aug 2020 11:12:36 -0700 From: Josh Triplett To: linux-kernel@vger.kernel.org Cc: Christian Brauner , Jens Axboe , Michael Kerrisk , linux-doc@vger.kernel.org Subject: pidfd and O_NONBLOCK Message-ID: <20200811181236.GA18763@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As far as I can tell, O_NONBLOCK has no effect on a pidfd. When calling waitid on a pidfd for a running process, it always blocks unless you provide WNOHANG. I don't think anything depends on that behavior. Would it be possible to make O_NONBLOCK on a pidfd cause waitid on a running process to return EWOULDBLOCK? This would make it easier to use pidfd in some non-blocking event loops. - Josh Triplett