closes bpo-38713: Expose P_PIDFD in os if it's defined. (GH-17071)

https://bugs.python.org/issue38713
This commit is contained in:
Benjamin Peterson 2019-11-05 21:58:31 -08:00 committed by Miss Islington (bot)
parent 6c4c45efae
commit 5c0c325453
7 changed files with 40 additions and 6 deletions

View file

@ -85,6 +85,9 @@ corresponding Unix manual entries for more information on calls.");
#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 @@ all_ins(PyObject *m)
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;