Skip to content

gh-154435: Fix os.posix_fadvise() and os.posix_fallocate() on DragonFly BSD#154436

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:posix-fallocate-dragonfly
Jul 22, 2026
Merged

gh-154435: Fix os.posix_fadvise() and os.posix_fallocate() on DragonFly BSD#154436
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:posix-fallocate-dragonfly

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 22, 2026

Copy link
Copy Markdown
Member

POSIX specifies that these functions return the error number and do not set errno, but on DragonFly BSD they return -1 and set errno, so OSError was raised with [Errno -1].

Use errno if the function returns -1. This also fixes retrying on EINTR, which compared the returned value with EINTR.

…ragonFly BSD

They return -1 and set errno instead of returning the error number, so
OSError was raised with a meaningless error code.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 22, 2026
@serhiy-storchaka
serhiy-storchaka merged commit 08a0d10 into python:main Jul 22, 2026
61 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@serhiy-storchaka
serhiy-storchaka deleted the posix-fallocate-dragonfly branch July 22, 2026 08:39
@bedevere-app

bedevere-app Bot commented Jul 22, 2026

Copy link
Copy Markdown

GH-154451 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 22, 2026
@bedevere-app

bedevere-app Bot commented Jul 22, 2026

Copy link
Copy Markdown

GH-154452 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 22, 2026
@bedevere-app

bedevere-app Bot commented Jul 22, 2026

Copy link
Copy Markdown

GH-154453 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 22, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 22, 2026
…DragonFly BSD (GH-154436) (GH-154453)

They return -1 and set errno instead of returning the error number, so
OSError was raised with a meaningless error code.
(cherry picked from commit 08a0d10)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant