Support shmget(IPC_PRIVATE, …) on Windows#5519
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. |
nikic
left a comment
There was a problem hiding this comment.
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_PRIVATEby 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.