closes bpo-38713: Expose P_PIDFD in os if it's defined. (GH-17071)
https://bugs.python.org/issue38713
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 46cf7b2..f738630 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -85,6 +85,9 @@
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> /* For WNOHANG */
#endif
+#ifdef HAVE_LINUX_WAIT_H
+#include <linux/wait.h> // For P_PIDFD
+#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
@@ -14099,6 +14102,9 @@
if (PyModule_AddIntMacro(m, P_PID)) return -1;
if (PyModule_AddIntMacro(m, P_PGID)) return -1;
if (PyModule_AddIntMacro(m, P_ALL)) return -1;
+#ifdef P_PIDFD
+ if (PyModule_AddIntMacro(m, P_PIDFD)) return -1;
+#endif
#endif
#ifdef WEXITED
if (PyModule_AddIntMacro(m, WEXITED)) return -1;