-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Support shmget(IPC_PRIVATE, …) on Windows #5519
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
Conversation
Can we test this? |
We map the POSIX semantics of `IPC_PRIVATE` by creating unnamed file mapping objects on Windows. While that is not particularly useful for ext/shmop, which is the only bundled extension which uses `shmget()`, it may be useful for external extensions.
I added a test to verify that private SHM is private. Adding a test to verify that private SHM can be shared between threads would likely require to have a suitable SAPI available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable.
Do you think it would make sense to apply this to 7.3 as well? I see this as a bug fix in Unix emulation.
I also see this as bug fix, and applying to PHP 7.3 would be helpful for APCu (and maybe some other extensions), but I'm somewhat concerned about the BC break for existing code calling Somewhat related: shouldn't we introduce a constant to make |
As they would already see that behavior on Linux, I don't think this is a problem. Using shmop() as Windows-only functionality seems somewhat unusual to me.
Agree. |
Well, I think you're right, so I've filed https://bugs.php.net/79566. For |
Applied as f33cf52. Thanks! |
We map the POSIX semantics of
IPC_PRIVATE
by creating unnamed filemapping objects on Windows. While that is not particularly useful for
ext/shmop, which is the only bundled extension which uses
shmget()
,and even constitutes a potential BC break for
shmop_open()
, it maybe useful for external extensions.