Skip to content

Commit 4c83aa2

Browse files
committed
pythongh-108765: Include explicitly <unistd.h> in signalmodule.c
unistd.h is needed by alarm() and pause().
1 parent 9a2f2f4 commit 4c83aa2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,8 @@ Porting to Python 3.13
11201120
* ``Python.h`` no longer includes the ``<unistd.h>`` standard header file. If
11211121
needed, it should now be included explicitly. For example, it provides the
11221122
functions: ``read()``, ``write()``, ``close()``, ``isatty()``, ``lseek()``,
1123-
``getpid()``, ``getcwd()``, ``sysconf()`` and ``getpagesize()``.
1123+
``getpid()``, ``getcwd()``, ``sysconf()``, ``getpagesize()``, ``alarm()`` and
1124+
``pause()``.
11241125
As a consequence, ``_POSIX_SEMAPHORES`` and ``_POSIX_THREADS`` macros are no
11251126
longer defined by ``Python.h``. The ``HAVE_UNISTD_H`` and ``HAVE_PTHREAD_H``
11261127
macros defined by ``Python.h`` can be used to decide if ``<unistd.h>`` and

Modules/signalmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "pycore_pystate.h" // _PyThreadState_GET()
1515
#include "pycore_signal.h" // _Py_RestoreSignals()
1616

17+
#include <unistd.h> // alarm()
1718
#ifndef MS_WINDOWS
1819
# include "posixmodule.h" // _PyLong_FromUid()
1920
#endif

0 commit comments

Comments
 (0)