|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #73340 SHMOP: Access to SHM_LOCK, SHM_UNLOCK
Submitted: 2016-10-18 18:11 UTC Modified: 2021-10-12 17:11 UTC
From: narf at devilix dot net Assigned:
Status: Open Package: *Extensibility Functions
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: narf at devilix dot net
New email:
PHP Version: OS:


 [2016-10-18 18:11 UTC] narf at devilix dot net
I was looking for a way to store encryption keys in (guaranteed to be non-swap) memory, and apparently setting the SHM_LOCK flag on a shared memory segment seems to be the only way to do that.

Obviously, PHP doesn't expose shmctl() directly and that's probably for a good reason, but can we have something like shmop_lock(), or an optional parameter to shmop_open()?

(on a related note, shmop_stat() would be nice too)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-12 17:11 UTC]
-Package: POSIX related +Package: *Extensibility Functions
 [2021-10-12 17:11 UTC]
SHM_LOCK is not part of POSIX[1], so might not be available
everywhere, and I don't think there's anything like that on

[1] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 17:01:30 2024 UTC