linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: linux-kernel@vger.kernel.org
Cc: Christian Brauner <christian@brauner.io>,
	Jens Axboe <axboe@kernel.dk>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-doc@vger.kernel.org
Subject: pidfd and O_NONBLOCK
Date: Tue, 11 Aug 2020 11:12:36 -0700	[thread overview]
Message-ID: <20200811181236.GA18763@localhost> (raw)

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

             reply	other threads:[~2020-08-11 18:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 18:12 Josh Triplett [this message]
2020-08-11 20:10 ` pidfd and O_NONBLOCK Christian Brauner
2020-08-11 21:13   ` Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200811181236.GA18763@localhost \
    --to=josh@joshtriplett.org \
    --cc=axboe@kernel.dk \
    --cc=christian@brauner.io \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).