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
 [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

Pull Requests

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: Mon Oct 14 17:01:28 2024 UTC