summaryrefslogtreecommitdiff
path: root/ext/shmop
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2018-10-13 14:16:33 +0200
committerPeter Kokot <peterkokot@gmail.com>2018-10-13 14:16:33 +0200
commit3362620b5f8716ce480b6f12269596c2d2351a52 (patch)
tree775f03a346d980fda9b2c725349f3c51c06bfaed /ext/shmop
parentedefd16fbc96d2ca4600544e5d5902591bf0695d (diff)
downloadphp-git-3362620b5f8716ce480b6f12269596c2d2351a52.tar.gz
Trim trailing whitespace in source code files
Diffstat (limited to 'ext/shmop')
-rw-r--r--ext/shmop/README34
1 files changed, 17 insertions, 17 deletions
diff --git a/ext/shmop/README b/ext/shmop/README
index 2553f3fe18..cb7b502f92 100644
--- a/ext/shmop/README
+++ b/ext/shmop/README
@@ -9,32 +9,32 @@ Shared Memory Operations Extension to PHP
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 :)).
+ 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
+ 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
+ (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)
@@ -42,28 +42,28 @@ 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
-
+