diff options
Diffstat (limited to 'main/streams/mmap.c')
-rw-r--r-- | main/streams/mmap.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/streams/mmap.c b/main/streams/mmap.c index e8ee8bd152..4b8d356881 100644 --- a/main/streams/mmap.c +++ b/main/streams/mmap.c @@ -51,6 +51,20 @@ PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC) return php_stream_set_option(stream, PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_UNMAP, NULL) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0; } +PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, off_t readden TSRMLS_DC) +{ + int ret = 1; + + if (php_stream_seek(stream, readden, SEEK_CUR) != 0) { + ret = 0; + } + if (php_stream_mmap_unmap(stream) == 0) { + ret = 0; + } + + return ret; +} + /* * Local variables: * tab-width: 4 |