From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 2/8] Fallback PIDFD_GET_INFO related definitions
Date: Mon, 7 Jul 2025 13:48:11 +0200 [thread overview]
Message-ID: <aGuz-zaoq_B125m7@yuki.lan> (raw)
In-Reply-To: <20250704-ioctl_pidfd_suite-v2-2-88a6466d9f62@suse.com>
Hi!
> configure.ac | 2 ++
> include/lapi/pidfd.h | 37 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 39 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index 69c5be7362a0e9f2fdaf3e6bd01f92f6f4880108..7132c00df97870e234fd5b8c9fcaf1beb263cf06 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -259,6 +259,8 @@ AC_CHECK_TYPES([struct cachestat],,,[#include <sys/mman.h>])
> AC_CHECK_TYPES([struct mnt_id_req],,,[#include <sys/mount.h>])
> AC_CHECK_TYPES([struct statmount],,,[#include <sys/mount.h>])
>
> +AC_CHECK_TYPES([struct pidfd_info],,,[#include <uapi/linux/pidfd.h>])
^
Just: <linux/pidfd.h>
When kernel headers are packaged and later installed on a system they
do not have the uapi/ directory prefix anymore.
> +
> # Tools knobs
>
> # Bash
> diff --git a/include/lapi/pidfd.h b/include/lapi/pidfd.h
> index 9ca8e5aa23626646ebb2f18880abd5e52298bfc6..55a44d5840c01bda7b31237c5c0d54ebba8155c5 100644
> --- a/include/lapi/pidfd.h
> +++ b/include/lapi/pidfd.h
> @@ -8,16 +8,53 @@
> #define LAPI_PIDFD_H__
>
> #include <fcntl.h>
> +#include <stdint.h>
> +#include <sys/ioctl.h>
> +
> #ifdef HAVE_SYS_PIDFD_H
> # include <sys/pidfd.h>
> #endif
> +
> #include "config.h"
> #include "lapi/syscalls.h"
>
> +#ifndef HAVE_STRUCT_PIDFD_INFO
> +struct pidfd_info {
> + uint64_t mask;
> + uint64_t cgroupid;
> + uint32_t pid;
> + uint32_t tgid;
> + uint32_t ppid;
> + uint32_t ruid;
> + uint32_t rgid;
> + uint32_t euid;
> + uint32_t egid;
> + uint32_t suid;
> + uint32_t sgid;
> + uint32_t fsuid;
> + uint32_t fsgid;
> + int32_t exit_code;
> + uint32_t coredump_mask;
> + uint32_t __spare1;
> +};
> +#endif
> +
> #ifndef PIDFD_NONBLOCK
> #define PIDFD_NONBLOCK O_NONBLOCK
> #endif
Generally you are supposed to indent the inner macros by spaces after
the hash. So it looks like:
#ifndef ..
# define
# ifdef
# define
# endif
#endif
With these two small things fixed:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-07-07 11:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 11:30 [LTP] [PATCH v2 0/8] ioctl_pidfd testing suite Andrea Cervesato
2025-07-04 11:30 ` [LTP] [PATCH v2 1/8] Provide pidfd parameter in tst_clone_args Andrea Cervesato
2025-07-07 11:44 ` Cyril Hrubis
2025-07-04 11:30 ` [LTP] [PATCH v2 2/8] Fallback PIDFD_GET_INFO related definitions Andrea Cervesato
2025-07-07 11:48 ` Cyril Hrubis [this message]
2025-07-04 11:30 ` [LTP] [PATCH v2 3/8] Add ioctl_pidfd01 test Andrea Cervesato
2025-07-07 12:00 ` Cyril Hrubis
2025-07-04 11:30 ` [LTP] [PATCH v2 4/8] Add ioctl_pidfd02 test Andrea Cervesato
2025-07-07 12:33 ` Cyril Hrubis
2025-07-07 15:25 ` Andrea Cervesato via ltp
2025-07-07 15:28 ` Andrea Cervesato via ltp
2025-07-07 15:31 ` Cyril Hrubis
2025-07-07 15:39 ` Cyril Hrubis
2025-07-07 15:37 ` Cyril Hrubis
2025-07-07 16:04 ` Andrea Cervesato via ltp
2025-07-07 16:06 ` Andrea Cervesato via ltp
2025-07-04 11:30 ` [LTP] [PATCH v2 5/8] Add ioctl_pidfd03 test Andrea Cervesato
2025-07-07 12:44 ` Cyril Hrubis
2025-07-04 11:30 ` [LTP] [PATCH v2 6/8] Add ioctl_pidfd04 test Andrea Cervesato
2025-07-07 12:56 ` Cyril Hrubis
2025-07-04 11:30 ` [LTP] [PATCH v2 7/8] Add ioctl_pidfd05 test Andrea Cervesato
2025-07-07 13:16 ` Cyril Hrubis
2025-07-04 11:30 ` [LTP] [PATCH v2 8/8] Add ioctl_pidfd06 test Andrea Cervesato
2025-07-07 13:27 ` Cyril Hrubis
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=aGuz-zaoq_B125m7@yuki.lan \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/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