Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-110014: Fix inconsistent struct definition in pycore_semaphore.h
The pycore_semaphore.h header is included by Python/lock.c and
Python/parking_lot.c. The macro `_POSIX_SEMAPHORES` was not consistently
defined across the two files (due to a missing include of `<unistd.h>`)
leading to different struct definitions. The RHEL8 ppc64le LTO buildbot
correctly warned due to this issue.
  • Loading branch information
colesbury committed Sep 28, 2023
commit 6e0228b7438d258e90e20ab7ee1bd045e489411a
4 changes: 4 additions & 0 deletions Include/internal/pycore_semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
# error "Require native threads. See https://bugs.python.org/issue31370"
#endif

#ifndef MS_WINDOWS
# include <unistd.h> // _POSIX_SEMAPHORES
#endif

#if (defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES+0) != -1 && \
defined(HAVE_SEM_TIMEDWAIT))
# define _Py_USE_SEMAPHORES
Expand Down