8000 gh-108765: Include explicitly <unistd.h> in signalmodule.c (#111402) · iritkatriel/cpython@64ca0a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 64ca0a9

Browse files
vstinneriritkatriel
authored andcommitted
pythongh-108765: Include explicitly <unistd.h> in signalmodule.c (python#111402)
unistd.h is needed by alarm() and pause() functions.
1 parent c48ec85 commit 64ca0a9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Doc/whatsnew/3.13.rst

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

Modules/signalmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
# include "socketmodule.h" // SOCKET_T
2222
#endif
2323

24+
#ifdef HAVE_UNISTD_H
25+
# include <unistd.h> // alarm()
26+
#endif
2427
#ifdef MS_WINDOWS
2528
# ifdef HAVE_PROCESS_H
2629
# include <process.h>

0 commit comments

Comments
 (0)
0