diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 4b249ed92c3..d3ca8c0476d 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3656,9 +3656,10 @@ written in Python, such as a mail server's external command delivery program. .. data:: EX_OK - Exit code that means no error occurred. + Exit code that means no error occurred. May be taken from the defined value of + ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero. - .. availability:: Unix. + .. availability:: Unix, Windows. .. data:: EX_USAGE diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 25ddc82cb89..73e7e60fe63 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -23,6 +23,10 @@ # include #endif +#if !defined(EX_OK) && defined(EXIT_SUCCESS) +#define EX_OK EXIT_SUCCESS +#endif + #ifdef __VXWORKS__ # include "pycore_bitutils.h" // _Py_popcount32() #endif