Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: shm_remove - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SESAM データベース関数" width="11" height="7"/> <shm_remove_var
Last updated: Thu, 31 May 2007

view this page in

shm_remove

(PHP 4, PHP 5)

shm_remove — Unix システムから共有メモリを削除する

説明

bool shm_remove ( int $shm_identifier )

shm_remove() は、共有メモリ shm_identifier を削除します。 全てのデータは破棄されます。

shm_remove_var() も参照ください。



add a note add a note User Contributed Notes
shm_remove
aaron DURP segura DURP gmail DURP com
20-Aug-2006 08:55
It appears that you must be connected to the shm segment in order to remove it.

<?php
shm_remove
($shm);
shm_detach($shm);
?>

works, while

<?php
shm_detach
($shm);
shm_remove($shm);
?>

produces "Warning: shm_remove(): The parameter is not a valid shm_identifier ..."
cu at ulakbim dot gov dot tr
30-Dec-1999 01:30
Though it says **shm_identifier** in
<PRE>
  int shm_remove(int shm_identifier);
</PRE>
and
<PRE>
  shm_attach() returns an **id** that that can be used to access the System V...
</PRE>
a snippet like this:
<PRE>
  $key = 1234;
  $shm=shm_attach($key);
  // do whatever...
  shm_remove($shm);
</PRE>
produces an error like
Warning: 2(which is the value of $shm) is not a existing SysV shared memory key in /usr/cu/web/sema.php on line 44...
The documentation confused me a bit. I thought shm_remove would get the shm handle/id that returns from shm_attach, not the key given to shm_attach. So, use instead:
<PRE>
  shm_remove($key);
</PRE>
which is what is intended indeed.

 
show source | credits | sitemap | contact | advertising | mirror sites