1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- typedef enum {
-
- PHP_STREAM_MMAP_SUPPORTED,
-
- PHP_STREAM_MMAP_MAP_RANGE,
-
- PHP_STREAM_MMAP_UNMAP
- } php_stream_mmap_operation_t;
- typedef enum {
- PHP_STREAM_MAP_MODE_READONLY,
- PHP_STREAM_MAP_MODE_READWRITE,
- PHP_STREAM_MAP_MODE_SHARED_READONLY,
- PHP_STREAM_MAP_MODE_SHARED_READWRITE
- } php_stream_mmap_access_t;
- typedef struct {
-
- size_t offset;
- size_t length;
- php_stream_mmap_access_t mode;
-
- char *mapped;
- } php_stream_mmap_range;
- #define PHP_STREAM_MMAP_ALL 0
- #define PHP_STREAM_MMAP_MAX (512 * 1024 * 1024)
- #define php_stream_mmap_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_MMAP_API, PHP_STREAM_MMAP_SUPPORTED, NULL) == 0 ? 1 : 0)
- #define php_stream_mmap_possible(stream) (!php_stream_is_filtered((stream)) && php_stream_mmap_supported((stream)))
- BEGIN_EXTERN_C()
- PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_access_t mode, size_t *mapped_len);
- #define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len))
- PHPAPI int _php_stream_mmap_unmap(php_stream *stream);
- #define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream))
- PHPAPI int _php_stream_mmap_unmap_ex(php_stream *stream, zend_off_t readden);
- #define php_stream_mmap_unmap_ex(stream, readden) _php_stream_mmap_unmap_ex((stream), (readden))
- END_EXTERN_C()
|