]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593)
authorVictor Stinner <vstinner@python.org>
Thu, 5 Dec 2024 09:39:44 +0000 (10:39 +0100)
committerGitHub <noreply@github.com>
Thu, 5 Dec 2024 09:39:44 +0000 (10:39 +0100)
Misc/NEWS.d/next/Library/2024-12-04-11-01-16.gh-issue-93312.9sB-Qw.rst [new file with mode: 0644]
Modules/posixmodule.c
configure
configure.ac
pyconfig.h.in

diff --git a/Misc/NEWS.d/next/Library/2024-12-04-11-01-16.gh-issue-93312.9sB-Qw.rst b/Misc/NEWS.d/next/Library/2024-12-04-11-01-16.gh-issue-93312.9sB-Qw.rst
new file mode 100644 (file)
index 0000000..e245fa2
--- /dev/null
@@ -0,0 +1,2 @@
+Include ``<sys/pidfd.h>`` to get ``os.PIDFD_NONBLOCK`` constant. Patch by
+Victor Stinner.
index 6eb7054b566e3f79179928bae715523dd55116fa..2c26fbeac9a1be6fa74061bdac79e0820269f12a 100644 (file)
@@ -73,6 +73,9 @@
 #ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>           // futimes()
 #endif
+#ifdef HAVE_SYS_PIDFD_H
+#  include <sys/pidfd.h>          // PIDFD_NONBLOCK
+#endif
 
 
 // SGI apparently needs this forward declaration
index 2fa473b9fe32c0a62d7cb11feb66576c49796a8a..5e9bcb602d884e1bac282f1d67283969d7261a86 100755 (executable)
--- a/configure
+++ b/configure
@@ -11178,6 +11178,12 @@ if test "x$ac_cv_header_sys_param_h" = xyes
 then :
   printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h
 
+fi
+ac_fn_c_check_header_compile "$LINENO" "sys/pidfd.h" "ac_cv_header_sys_pidfd_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_pidfd_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SYS_PIDFD_H 1" >>confdefs.h
+
 fi
 ac_fn_c_check_header_compile "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default"
 if test "x$ac_cv_header_sys_poll_h" = xyes
index 8ca8e0f78027426408ba30e01639076fcb3bfd04..bf3685e1b1b209d515d44fb3713b8cfa406c5b7f 100644 (file)
@@ -2932,7 +2932,7 @@ AC_CHECK_HEADERS([ \
   linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \
   sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
   sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \
-  sys/loadavg.h sys/lock.h sys/memfd.h sys/mkdev.h sys/mman.h sys/modem.h sys/param.h sys/poll.h \
+  sys/loadavg.h sys/lock.h sys/memfd.h sys/mkdev.h sys/mman.h sys/modem.h sys/param.h sys/pidfd.h sys/poll.h \
   sys/random.h sys/resource.h sys/select.h sys/sendfile.h sys/socket.h sys/soundcard.h sys/stat.h \
   sys/statvfs.h sys/sys_domain.h sys/syscall.h sys/sysmacros.h sys/termio.h sys/time.h sys/times.h sys/timerfd.h \
   sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h sys/xattr.h sysexits.h syslog.h \
index 924d86627b0e9bac0f9e172f2f5e815144fb90dc..6a1f1284650b9f94dd70589a15b06edadafc413f 100644 (file)
 /* Define to 1 if you have the <sys/param.h> header file. */
 #undef HAVE_SYS_PARAM_H
 
+/* Define to 1 if you have the <sys/pidfd.h> header file. */
+#undef HAVE_SYS_PIDFD_H
+
 /* Define to 1 if you have the <sys/poll.h> header file. */
 #undef HAVE_SYS_POLL_H