public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Matheus Castanho <msc@linux.ibm.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 01/15] linux: Add pidfd_open
Date: Wed, 01 Jun 2022 17:53:11 -0300	[thread overview]
Message-ID: <87tu942jbf.fsf@linux.ibm.com> (raw)
In-Reply-To: <33467020-1749-e30e-5f38-8d046525e1dc@linaro.org>


Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:

> On 01/06/2022 15:02, Matheus Castanho wrote:
>>
>> Hi Adhemerval,
>>
>> Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
>>
>>> This was added on Linux 5.3 (32fcb426ec001cb6d5a4a195091a8486ea77e2df)
>>> as a way to retrieve a pid file descriptors for process that has not
>>> been created CLONE_PIDFD (by usual fork/clone).
>>> ---
>> [...]
>>>  create mode 100644 sysdeps/unix/sysv/linux/tst-pidfd-consts.py
>>
>> This new test fails on systems with older kernels (e.g. Debian 10 -
>> kernel 4.19). Looks like linux/pidfd.h is not available on such systems,
>> so list_macros fails when trying to compile source_2.
>>
>> FAIL: misc/tst-pidfd-consts
>> original exit status 1
>> /tmp/tmp5g72cxka/test.c:2:10: fatal error: linux/pidfd.h: No such file or directory
>>  #include <linux/pidfd.h>
>>           ^~~~~~~~~~~~~~~
>> compilation terminated.
>
> Not sure how to properly handle it, maybe in this case return UNSUPPORTED:
>
> diff --git a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
> index 75df0ebed5..cfc9fbc7cb 100644
> --- a/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
> +++ b/sysdeps/unix/sysv/linux/tst-pidfd-consts.py
> @@ -19,6 +19,7 @@
>
>  import argparse
>  import sys
> +import subprocess
>
>  import glibcextract
>  import glibcsyscalls
> @@ -35,7 +36,8 @@ def main():
>
>      linux_version_headers = glibcsyscalls.linux_kernel_version(args.cc)
>      linux_version_glibc = (5, 18)
> -    sys.exit(glibcextract.compare_macro_consts(
> +    try:
> +        sys.exit(glibcextract.compare_macro_consts(
>                  '#include <sys/pidfd.h>\n',
>                  '#include <asm/fcntl.h>\n'
>                  '#include <linux/pidfd.h>\n',
> @@ -44,6 +46,8 @@ def main():
>                  None,
>                  linux_version_glibc > linux_version_headers,
>                  linux_version_headers > linux_version_glibc))
> +    except subprocess.CalledProcessError:
> +        sys.exit(77)
>
>  if __name__ == '__main__':
>      main()

I don't think there's much else to do besides returning UNSUPPORTED. Of
course this will mark the test as UNSUPPORTED for any failure in the
internal gcc call, but I don't see it as a problem today since this
function seems to be used only for macro processing.

Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
Tested-by: Matheus Castanho <msc@linux.ibm.com>

Thanks!
Matheus Castanho

  reply	other threads:[~2022-06-01 20:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 17:44 [PATCH v2 00/15] linux: Add new syscalls Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 01/15] linux: Add pidfd_open Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-06-01 18:02   ` Matheus Castanho
2022-06-01 18:49     ` Adhemerval Zanella
2022-06-01 20:53       ` Matheus Castanho [this message]
2022-06-01 22:22         ` Joseph Myers
2022-02-07 17:44 ` [PATCH v2 02/15] linux: Add pidfd_getfd Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-02-07 17:44 ` [PATCH v2 03/15] linux: Add pidfd_send_signal Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-02-07 17:44 ` [PATCH v2 04/15] linux: Add P_PIDFD Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-02-07 17:44 ` [PATCH v2 05/15] linux: Add tst-pidfd.c Adhemerval Zanella
2022-05-16 21:12   ` Carlos O'Donell
2022-02-07 17:44 ` [PATCH v2 06/15] linux: Add process_madvise Adhemerval Zanella
2022-05-31 22:03   ` Carlos O'Donell
2022-06-01 18:04     ` Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 07/15] linux: Add process_mrelease Adhemerval Zanella
2022-05-31 22:12   ` Carlos O'Donell
2022-06-01 18:35     ` Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 08/15] linux: Add fsopen Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 09/15] linux: Add fsmount Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 10/15] linux: Add move_mount Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 11/15] linux: Add fsconfig Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 12/15] linux: Add fspick Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 13/15] linux: Add open_tree Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 14/15] linux: Add tst-mount to check for Linux new mount API Adhemerval Zanella
2022-02-07 17:44 ` [PATCH v2 15/15] linux: Add mount_setattr Adhemerval Zanella
2022-05-16 21:12 ` [PATCH v2 00/15] linux: Add new syscalls Carlos O'Donell

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=87tu942jbf.fsf@linux.ibm.com \
    --to=msc@linux.ibm.com \
    --cc=adhemerval.zanella@linaro.org \
    --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).