Skip to content

ext/session: remove dead F_SETFD fallback in mod_files - #25669

Open
jorgsowa wants to merge 1 commit into
php:masterfrom
jorgsowa:session-drop-fd-cloexec-fallback
Open

jorgsowa wants to merge 1 commit into
php:masterfrom
jorgsowa:session-drop-fd-cloexec-fallback

Conversation

@jorgsowa

Copy link
Copy Markdown
Contributor

The session file is already opened with O_CLOEXEC, which POSIX.1-2008 requires, so the fcntl() fallback for systems without it is never compiled. Windows has neither, so nothing changes there either.

Other places also guard for O_CLOEXEC, but I want to focus only on ext/session.

The session file is already opened with O_CLOEXEC, which POSIX.1-2008
requires, so the fcntl() fallback for systems without it is never
compiled. Windows has neither, so nothing changes there either.
@jorgsowa jorgsowa self-assigned this Nov 23, 2026
@jorgsowa
jorgsowa requested a review from Girgias as a code owner November 23, 2026 11:58
@Girgias
Girgias requested a review from devnexen November 23, 2026 14:40

@iliaal iliaal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the fcntl() fallback. Solaris 10 lacks O_CLOEXEC, so removing the fallback lets a child inherit the session file descriptor across exec(). On platforms with O_CLOEXEC, the fallback already compiles out. Oracle documents O_CLOEXEC as a Solaris 11 addition.

@jorgsowa

Copy link
Copy Markdown
Contributor Author

My reasoning for master: Solaris 10 Extended Support ends in January 2027, before the next PHP release. CI only runs Solaris 11.4, so Solaris 10 isn't tested anyway.

Is there a policy on which Solaris versions master supports? Maybe we should change the supported version for Solaris in CI pipeline? Because we are not even sure if it compiles properly.

@iliaal

iliaal commented Nov 24, 2026

Copy link
Copy Markdown
Member

Hmm learned something new (Solaris eol), I suppose for master it is non-blocker since PHP 8.7 won't come out till later.

@jorgsowa

Copy link
Copy Markdown
Contributor Author

This is related to #25659

Do you think @shivammathur that it's good approach to treat CI platform as the minimal we support for Solaris? At least for master.

@shivammathur

Copy link
Copy Markdown
Member

@jorgsowa Could you try keeping the fcntl() fallback and moving it just after open() succeeds, before flock() can block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants