diff mbox series

[1/2] lapi/pidfd: adding pidfd header file

Message ID 20220805063401.1647479-2-liwang@redhat.com
State Accepted
Headers show
Series fix compiling errors on fedora-rawhide | expand

Commit Message

Li Wang Aug. 5, 2022, 6:34 a.m. UTC
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(+)

Comments

Petr Vorel Aug. 5, 2022, 7:14 a.m. UTC | #1
Hi Li,

obviously correct, thanks!

BTW if you wish to use rawhide in CI, we can give it a try
(could be reverted to fedora:latest - i.e. the latest release if got
problematic).

Kind regards,
Petr
Li Wang Aug. 5, 2022, 10:04 a.m. UTC | #2
Hi Petr,

On Fri, Aug 5, 2022 at 3:14 PM Petr Vorel <pvorel@suse.cz> wrote:

> Hi Li,
>
> obviously correct, thanks!
>

Patchset merged.


> BTW if you wish to use rawhide in CI, we can give it a try
> (could be reverted to fedora:latest - i.e. the latest release if got
> problematic).
>

Thanks, but I'm not very passionate about enabling it, as we now have
ltp quick test on fedora-rawhide internally(RedHat), but obviously that
consumed people's energy on debugging *temporally* failure[1]. I'm still
thinking if that's worth it.

[1] some of them disappear after code-rebase or package upgrading
Petr Vorel Aug. 5, 2022, 10:36 a.m. UTC | #3
...
> Thanks, but I'm not very passionate about enabling it, as we now have
> ltp quick test on fedora-rawhide internally(RedHat), but obviously that
> consumed people's energy on debugging *temporally* failure[1]. I'm still
> thinking if that's worth it.

Hi Li,

Sure, np.
Petr

> [1] some of them disappear after code-rebase or package upgrading
diff mbox series

Patch

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"