public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>,
	 Philip Withnall <bugzilla@tecnocode.co.uk>
Subject: Re: [PATCH v5 4/4] linux: Add pidfd_getpid
Date: Tue, 23 May 2023 14:31:23 +0100	[thread overview]
Message-ID: <CAMw=ZnR7Yg61MVog=a_OkRa8H5TmaqZCyySLyzPcTxoZHnXkQw@mail.gmail.com> (raw)
In-Reply-To: <20230523132749.1646124-5-adhemerval.zanella@linaro.org>

On Tue, 23 May 2023 at 14:28, Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> This interface allows to obtain the associated process ID from the
> process file descriptor.  It is done by parsing the procps fdinfo
> information.  Its prototype is:
>
>    pid_t pidfd_getpid (int fd)
>
> It returns the associated pid or -1 in case of an error and sets the
> errno accordingly.  The possible errno values are those from open,
> read, and close (used on procps parsing), along with:
>
>    - EBADF if the FD is negative, does not have a PID associatedi, or
>      if the fdinfo fields contains a value larger than pid_t.
>
>    - EREMOTE if the PID is in a separate namespace.
>
>    - ESRCH if the process is already terminated.
>
> Checked on x86_64-linux-gnu on Linux 4.15 (no CLONE_PID or waitid
> support), Linux 5.15 (only clone support), and Linux 5.19 (full
> support including clone3).

Acked-by: Luca Boccassi <bluca@debian.org>

      reply	other threads:[~2023-05-23 13:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 13:27 [PATCH v5 0/4] Add pidfd_spawn, pidfd_spawnp, pidfd_fork, and pidfd_getpid Adhemerval Zanella
2023-05-23 13:27 ` [PATCH v5 1/4] posix: Add pidfd_spawn and pidfd_spawnp (BZ# 30349) Adhemerval Zanella
2023-05-23 13:27 ` [PATCH v5 2/4] posix: Add pidfd_fork Adhemerval Zanella
2023-05-23 13:27 ` [PATCH v5 3/4] posix: Add PIDFDFORK_NOSIGCHLD for pidfd_fork Adhemerval Zanella
2023-05-23 13:27 ` [PATCH v5 4/4] linux: Add pidfd_getpid Adhemerval Zanella
2023-05-23 13:31   ` Luca Boccassi [this message]

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='CAMw=ZnR7Yg61MVog=a_OkRa8H5TmaqZCyySLyzPcTxoZHnXkQw@mail.gmail.com' \
    --to=bluca@debian.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=bugzilla@tecnocode.co.uk \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).