com php-src: Update and refactor shmop extension's README: ext/shmop/README ext/shmop/README.md
| From: | Peter Kokot | Date: | Mon, 08 Oct 2018 04:27:17 +0000 |
| Subject: | com php-src: Update and refactor shmop extension's README: ext/shmop/README ext/shmop/README.md | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103383@lists.php.net to get a copy of this message | ||
Commit: c2cbf372356a932fbf269f88a8e711243e2e8946
Author: Peter Kokot <peterkokot@gmail.com> Mon, 8 Oct 2018 06:27:17 +0200
Parents: 4acc8500acd134dfab1a2ddb83aeb39fa1033abe
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c2cbf372356a932fbf269f88a8e711243e2e8946
Log:
Update and refactor shmop extension's README
The shmop functions are documented with more information in the PHP
manual.
Changed paths:
D ext/shmop/README
A ext/shmop/README.md
Diff:
diff --git a/ext/shmop/README b/ext/shmop/README
deleted file mode 100644
index 2553f3f..0000000
--- a/ext/shmop/README
+++ /dev/null
@@ -1,69 +0,0 @@
-last update Jan 2, 2002 (hackie@prohost.org/ilia@prohost.org)
-
-Shared Memory Operations Extension to PHP
-
- While developing a search deamon we needed a php based front end
- to communicate the deamon via SHM. PHP already had a shared memory
- extension (sysvshm) written by Christian Cartus <cartus@atrior.de>,
- unfortunately this extension was designed with PHP only in mind and
- offers high level features which are extremely bothersome for basic SHM
- we had in mind. After spending a day trying to reverse engineer and figure
- out the format of sysvshm we decided that it would be much easier to
- add our own extension to php for simple SHM operations, we were right :)).
-
-the functions are:
-
-int shmop_open(int key, string flags, int mode, int size)
-
- key - the key of/for the shared memory block
- flags - 4 flags are avalible
- a for read only access (sets SHM_RDONLY)
- w for read & write access
- c create or open an existing segment (sets IPC_CREATE)
- n create a new segment and fail if one already exists under same name (sets
IPC_CREATE|IPC_EXCL)
- (the n flag is mostly useful for security perpouses, so that you don't end up opening a
faked segment
- if someone guesses your key)
- mode - acsess mode same as for a file (0644) for example
- size - size of the block in bytes
-
- returns an identifier
-
-
-char shmop_read(int shmid, int start, int count)
-
- shmid - shmid from which to read
- start - offset from which to start reading
- count - how many bytes to read
-
- returns the data read
-
-int shmop_write(int shmid, string data, int offset)
-
- shmid - shmid from which to read
- data - string to put into shared memory
- offset - offset in shm to write from
-
- returns bytes written
-
-int shmop_size(int shmid)
-
- shmid - shmid for which to return the size
-
- returns the size in bytes of the shm segment
-
-
-int shmop_delete(int shmid)
-
- marks the segment for deletion, the segment will be deleted when all processes mapping it will
detach
-
- shmid - shmid which to mark for deletion
-
- returns 1 if all ok, zero on failure
-
-int shmop_close(int shmid)
-
- shmid - shmid which to close
-
- returns zero
-
-
diff --git a/ext/shmop/README.md b/ext/shmop/README.md
new file mode 100644
index 0000000..b89c0d8
--- /dev/null
+++ b/ext/shmop/README.md
@@ -0,0 +1,9 @@
+# Shared Memory Operations Extension to PHP
+
+While developing a search deamon we needed a php based front end to communicate
+the deamon via SHM. PHP already had a shared memory extension (sysvshm) written
+by Christian Cartus <cartus@atrior.de>, unfortunately this extension was designed
+with PHP only in mind and offers high level features which are extremely
+bothersome for basic SHM we had in mind. After spending a day trying to reverse
+engineer and figure out the format of sysvshm we decided that it would be much
+easier to add our own extension to php for simple SHM operations, we were right :)).