Skip to content

Commit 6efd9ea

Browse files
author
Ilia Alshanetsky
committed
Added notes about locking functions.
1 parent cf7101d commit 6efd9ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.STREAMS

+7-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ PHPAPI int php_stream_close(php_stream * stream);
3737
PHPAPI int php_stream_flush(php_stream * stream);
3838
PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence);
3939
PHPAPI off_t php_stream_tell(php_stream * stream);
40+
PHPAPI int php_stream_lock(php_stream * stream, int mode);
4041

4142
These (should) behave in the same way as the ANSI stdio functions with similar
42-
names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell.
43+
names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell, flock.
4344

4445
Opening Streams
4546
===============
@@ -157,6 +158,11 @@ can lead to a crash when the resource is later used/released.
157158
NOTE: If you are opening a stream and need it to be seekable, use the
158159
STREAM_MUST_SEEK option to php_stream_open_wrapper();
159160

161+
PHPAPI int php_stream_supports_lock(php_stream * stream);
162+
163+
This function will return either 1 (success) or 0 (failure) indicating whether or
164+
not a lock can be set on this stream. Typically you can only set locks on stdio streams.
165+
160166
Casting Streams
161167
===============
162168
What if your extension needs to access the FILE* of a user level file pointer?

0 commit comments

Comments
 (0)