Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit77bb0d5

Browse files
authored
gh-108765: Include explicitly <unistd.h> in signalmodule.c (#111402)
unistd.h is needed by alarm() and pause() functions.
1 parent8a158a7 commit77bb0d5

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
@@ -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: 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+
#ifdefHAVE_UNISTD_H
25+
# include<unistd.h>// alarm()
26+
#endif
2427
#ifdefMS_WINDOWS
2528
# ifdefHAVE_PROCESS_H
2629
# include<process.h>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp