Skip to content

ext/pcntl pcntl_signal_get_handler update.#13902

Closed
devnexen wants to merge 2 commits intophp:masterfrom
devnexen:pcntl_signal_get_handler_upd
Closed

ext/pcntl pcntl_signal_get_handler update.#13902
devnexen wants to merge 2 commits intophp:masterfrom
devnexen:pcntl_signal_get_handler_upd

Conversation

@devnexen
Copy link
Member

@devnexen devnexen commented Apr 7, 2024

The situation varies from platform to another, thus taking in account the complexity of it.

@devnexen devnexen force-pushed the pcntl_signal_get_handler_upd branch from 00a4b09 to 752fea8 Compare April 7, 2024 08:16
The situation varies from platform to another, thus taking in
account the complexity of it.
@devnexen devnexen force-pushed the pcntl_signal_get_handler_upd branch from 752fea8 to 3dc007e Compare April 7, 2024 11:42
if (signo < 1 || signo > 32) {
zend_argument_value_error(1, "must be between 1 and 32");
// note: max signal on mac is SIGUSR2 (31), no real time signals.
static int sigmax = NSIG - 1;
Copy link
Member

Choose a reason for hiding this comment

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

I think I'd prefer a non-static variable here. Otherwise we have it in a data section that's shared with other threads too.
The compiler will constant-fold and take care of the branch at compile-time anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wish we had constexpr in C :-) but sure will change.

Copy link
Member

Choose a reason for hiding this comment

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

I wish we had constexpr in C :-)

That's in C23 ;) But sadly we don't even have C11 yet in PHP

Copy link
Member

@ndossche ndossche left a comment

Choose a reason for hiding this comment

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

Seems legit to me, thanks!

@devnexen devnexen closed this in 01817e9 Apr 7, 2024
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.

2 participants