linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Christian Brauner <christian@brauner.io>,
	 Shuah Khan <shuah@kernel.org>,
	 "Liam R . Howlett" <Liam.Howlett@oracle.com>,
	 Suren Baghdasaryan <surenb@google.com>,
	 Vlastimil Babka <vbabka@suse.cz>,
	pedro.falcato@gmail.com,  linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org,  linux-fsdevel@vger.kernel.org,
	linux-api@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] introduce PIDFD_SELF
Date: Mon, 30 Sep 2024 12:33:18 +0200	[thread overview]
Message-ID: <87ttdxl9ch.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <cover.1727644404.git.lorenzo.stoakes@oracle.com> (Lorenzo Stoakes's message of "Mon, 30 Sep 2024 10:22:27 +0100")

* Lorenzo Stoakes:

> If you wish to utilise a pidfd interface to refer to the current process
> (from the point of view of userland - from the kernel point of view - the
> thread group leader), it is rather cumbersome, requiring something like:
>
> 	int pidfd = pidfd_open(getpid(), 0);
>
> 	...
>
> 	close(pidfd);
>
> Or the equivalent call opening /proc/self. It is more convenient to use a
> sentinel value to indicate to an interface that accepts a pidfd that we
> simply wish to refer to the current process.

The descriptor will refer to the current thread, not process, right?

The distinction matters for pidfd_getfd if a process contains multiple
threads with different file descriptor tables, and probably for
pidfd_send_signal as well.

Thanks,
Florian


  parent reply	other threads:[~2024-09-30 10:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30  9:22 [RFC PATCH 0/3] introduce PIDFD_SELF Lorenzo Stoakes
2024-09-30  9:22 ` [RFC PATCH 1/3] pidfd: refactor pidfd_get_pid/to_pid() and de-duplicate pid lookup Lorenzo Stoakes
2024-09-30  9:22 ` [RFC PATCH 2/3] pidfd: add PIDFD_SELF sentinel to refer to own process Lorenzo Stoakes
2024-09-30  9:22 ` [RFC PATCH 3/3] selftests: pidfd: add tests for PIDFD_SELF Lorenzo Stoakes
2024-09-30 10:33 ` Florian Weimer [this message]
2024-09-30 10:39   ` [RFC PATCH 0/3] introduce PIDFD_SELF Lorenzo Stoakes
2024-09-30 12:34     ` Christian Brauner
2024-09-30 13:10       ` Lorenzo Stoakes
2024-09-30 14:21         ` Aleksa Sarai
2024-09-30 14:32           ` Lorenzo Stoakes
2024-10-01 10:21             ` Christian Brauner
2024-10-01 14:31               ` Lorenzo Stoakes

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=87ttdxl9ch.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=christian@brauner.io \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=pedro.falcato@gmail.com \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    /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).