All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] lapi/pidfd: adding pidfd header file
Date: Fri,  5 Aug 2022 14:34:00 +0800	[thread overview]
Message-ID: <20220805063401.1647479-2-liwang@redhat.com> (raw)
In-Reply-To: <20220805063401.1647479-1-liwang@redhat.com>

The newer Glibc already provided wrapper for the series pidfd syscall,
so let's include the header file conditionally.

  # rpm -q glibc-devel
  glibc-devel-2.35.9000-31.fc37.ppc64le

  # rpm -ql glibc-devel | grep pidfd
  /usr/include/sys/pidfd.h

To get rid of compiling error from fedora-rawhide:

  tst_safe_macros.c: In function ‘safe_pidfd_open’:
  tst_safe_macros.c:135:16: error: implicit declaration of function ‘pidfd_open’ [-Werror=implicit-function-declaration]
  135 |         rval = pidfd_open(pid, flags);
      |                ^~~~~~~~~~

Signed-off-by: Li Wang <liwang@redhat.com>
---
 configure.ac         | 1 +
 include/lapi/pidfd.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 69b145b5f..d50ec1ea7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,7 @@ AC_CHECK_HEADERS_ONCE([ \
     sys/epoll.h \
     sys/fanotify.h \
     sys/inotify.h \
+    sys/pidfd.h
     sys/prctl.h \
     sys/shm.h \
     sys/timerfd.h \
diff --git a/include/lapi/pidfd.h b/include/lapi/pidfd.h
index 244d3acaf..9ca8e5aa2 100644
--- a/include/lapi/pidfd.h
+++ b/include/lapi/pidfd.h
@@ -8,6 +8,9 @@
 #define LAPI_PIDFD_H__
 
 #include <fcntl.h>
+#ifdef HAVE_SYS_PIDFD_H
+# include <sys/pidfd.h>
+#endif
 #include "config.h"
 #include "lapi/syscalls.h"
 
-- 
2.35.3


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

  reply	other threads:[~2022-08-05  6:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05  6:33 [LTP] [PATCH 0/2] fix compiling errors on fedora-rawhide Li Wang
2022-08-05  6:34 ` Li Wang [this message]
2022-08-05  7:14   ` [LTP] [PATCH 1/2] lapi/pidfd: adding pidfd header file Petr Vorel
2022-08-05 10:04     ` Li Wang
2022-08-05 10:36       ` Petr Vorel
2022-08-05  6:34 ` [LTP] [PATCH 2/2] lapi/fsmount: resolve conflict in different header files Li Wang
2022-08-05  7:38   ` Petr Vorel
2022-08-05  9:44     ` Li Wang

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=20220805063401.1647479-2-liwang@redhat.com \
    --to=liwang@redhat.com \
    --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 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.