Skip to content

Add PHP_IPC_PRIVATE constant #5527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented May 5, 2020

This constant makes IPC_PRIVATE available to userland, which is
useful for shmop_open() and sem_get(), for instance.

@nikic
Copy link
Member

nikic commented May 5, 2020

I don't think we want to expose this constant directly from core. It should be part of the shm exts (possibly defined by both, if not yet defined).

@nikic
Copy link
Member

nikic commented May 5, 2020

Or maybe defined by both under different prefixes, dunno.

@cmb69
Copy link
Member Author

cmb69 commented May 6, 2020

Well, it's actually about (at least) three extensions. Not sure, if I like how I've done it now (might be confusing, especially for the docs). I think I wouldn't like three differently named constants either.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

I don't really have a good suggestion of how to handle this :(

cmb69 added 2 commits May 6, 2020 17:19
This constant makes `IPC_PRIVATE` available to userland, which is
useful for `shmop_open()` and `sem_get()`, for instance.
We move the definition of `PHP_IPC_PRIVATE` to the three extensions
which actually can use it, but avoid duplicate definition.
@cmb69 cmb69 force-pushed the cmb/php-ipc-private branch from 6523c3f to a33d2f3 Compare May 6, 2020 15:22
@cmb69
Copy link
Member Author

cmb69 commented May 6, 2020

I've mailed internals.

@bishopb
Copy link
Contributor

bishopb commented May 11, 2020

The conditional definition from commit a33d2f3 seems reasonable to me.

Perhaps the constant should be named PHP_IPC_NEW, per guidance from the man page:

The name choice IPC_PRIVATE was perhaps unfortunate, IPC_NEW would more clearly show its function

@cmb69
Copy link
Member Author

cmb69 commented Mar 30, 2021

Thinking about this again, I do no longer think it is a good idea to use the same name. This can bite us, if, for instance, another extension defines the constant with another value. The proper way forward would be to define different constants for the different extensions, but apparently there is not much interested in having these, so I'm closing this PR.

@cmb69 cmb69 closed this Mar 30, 2021
@cmb69 cmb69 deleted the cmb/php-ipc-private branch March 30, 2021 10:16
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