All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/5] pidfd_getfd.h: add fallback
Date: Wed, 16 Feb 2022 15:09:16 +0100	[thread overview]
Message-ID: <Yg0FjFPfTOXxUbWx@pevik> (raw)
In-Reply-To: <1645005868-2373-3-git-send-email-xuyang2018.jy@fujitsu.com>

Hi Xu,

> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
>  configure.ac               |  1 +
>  include/lapi/pidfd_getfd.h | 26 ++++++++++++++++++++++++++
>  2 files changed, 27 insertions(+)
>  create mode 100644 include/lapi/pidfd_getfd.h

> diff --git a/configure.ac b/configure.ac
> index 8d2c5b1c4..49499704e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -115,6 +115,7 @@ AC_CHECK_FUNCS_ONCE([ \
>      open_tree \
>      openat \
>      openat2 \
> +    pidfd_getfd \
>      pidfd_open \
>      pidfd_send_signal \
>      pkey_mprotect \
> diff --git a/include/lapi/pidfd_getfd.h b/include/lapi/pidfd_getfd.h
> new file mode 100644
> index 000000000..1f488a518
> --- /dev/null
> +++ b/include/lapi/pidfd_getfd.h
> @@ -0,0 +1,26 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
> + * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
> + */
> +
> +#ifndef LAPI_PIDFD_GETFD_H__
> +#define LAPI_PIDFD_GETFD_H__
> +
> +#include "lapi/syscalls.h"
> +#include "config.h"
nit: IMHO it's better to always put config.h at the first place.

Otherwise LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> +
> +static inline void pidfd_getfd_supported(void)
> +{
> +	/* allow the tests to fail early */
> +	tst_syscall(__NR_pidfd_getfd);
> +}
> +
> +#ifndef HAVE_PIDFD_GETFD
> +static inline int pidfd_getfd(int pidfd, int targetfd, unsigned int flags)
> +{
> +	return tst_syscall(__NR_pidfd_getfd, pidfd, targetfd, flags);
> +}
> +#endif
> +
> +#endif /* LAPI_PIDFD_GETFD_H__ */

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-02-16 14:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 10:04 [LTP] [PATCH 1/5] kcmp.h: move it to ltp include/lapi directory Yang Xu
2022-02-16 10:04 ` [LTP] [PATCH 2/5] lapi/kcmp.h: Replace GPL with SPDX-License-Identifier Yang Xu
2022-02-16 14:05   ` Petr Vorel
2022-02-17 18:52   ` Petr Vorel
2022-02-18  2:13     ` xuyang2018.jy
2022-02-18  8:28       ` Petr Vorel
2022-02-16 10:04 ` [LTP] [PATCH 3/5] pidfd_getfd.h: add fallback Yang Xu
2022-02-16 14:09   ` Petr Vorel [this message]
2022-02-18  2:14     ` xuyang2018.jy
2022-02-16 10:04 ` [LTP] [PATCH 4/5] Add pidfd_getfd01 test Yang Xu
2022-02-17 19:20   ` Petr Vorel
2022-02-18  3:24     ` xuyang2018.jy
2022-02-18  7:02       ` Petr Vorel
2022-02-21 10:03         ` Richard Palethorpe
2022-02-21 12:42           ` Petr Vorel
2022-02-21 13:49             ` Richard Palethorpe
2022-02-18  8:57       ` Petr Vorel
2022-02-18  9:56         ` xuyang2018.jy
2022-02-18 10:15           ` Petr Vorel
2022-02-22  2:29             ` xuyang2018.jy
2022-02-17 19:28   ` Petr Vorel
2022-02-18  3:37     ` xuyang2018.jy
2022-02-18  6:59       ` Petr Vorel
2022-02-16 10:04 ` [LTP] [PATCH 5/5] syscalls/pidfd_getfd02: add basic error test Yang Xu
2022-02-17 19:56   ` Petr Vorel
2022-02-18  3:49     ` xuyang2018.jy
2022-02-18  6:50       ` Petr Vorel
2022-02-18  7:03         ` xuyang2018.jy
2022-02-18 10:58       ` Petr Vorel
2022-02-22  2:49         ` xuyang2018.jy
2022-02-16 14:02 ` [LTP] [PATCH 1/5] kcmp.h: move it to ltp include/lapi directory Petr Vorel

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=Yg0FjFPfTOXxUbWx@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xuyang2018.jy@fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.