php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
29 + 30 = ?
Subscribe to this entry?

 
 [2016-10-18 18:11 UTC] narf at devilix dot net
Description:
------------
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)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-12 17:11 UTC] cmb@php.net
-Package: POSIX related +Package: *Extensibility Functions
 [2021-10-12 17:11 UTC] cmb@php.net
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
Windows.

[1] <https://pubs.opengroup.org/onlinepubs/9699919799/functions/shmctl.html>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 09:01:27 2024 UTC