[issue35633] test_eintr fails on AIX since fcntl functions were modified
Kevin
report at bugs.python.org
Thu May 6 21:57:38 EDT 2021
Kevin <kadler at us.ibm.com> added the comment:
FYI, the problem here is that AIX fcntl returns EACCES in the case that the lock is held and non-blocking behavior was requested:
> The lockfx and lockf subroutines fail if one of the following is true:
Item
>
> EACCES The Command parameter is F_SETLK, the l_type field is F_RDLCK, and the segment of the file to be locked is already write-locked by another process.
> EACCES The Command parameter is F_SETLK, the l_type field is F_WRLCK, and the segment of a file to be locked is already read-locked or write-locked by another process.
https://www.ibm.com/docs/en/aix/7.1?topic=l-lockfx-lockf-flock-lockf64-subroutine
(Note the docs are a bit wonky referring to lockf/lockfx but talking about parameters and fields which apply to fcntl instead)
The lockf/flock APIs provided by AIX handle this appropriately, mapping EACCES to EWOULDBLOCK, but while Python calls the libbsd flock API, it uses its own lockf implementation which calls fcntl directly: https://github.com/python/cpython/blob/main/Modules/fcntlmodule.c#L426
----------
nosy: +kadler
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35633>
_______________________________________
More information about the Python-bugs-list
mailing list