Apache HTTPD
apr_mmap.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef APR_MMAP_H
18#define APR_MMAP_H
19
25#include "apr.h"
26#include "apr_pools.h"
27#include "apr_errno.h"
28#include "apr_ring.h"
29#include "apr_file_io.h" /* for apr_file_t */
30
31#ifdef BEOS
32#include <kernel/OS.h>
33#endif
34
35#ifdef __cplusplus
36extern "C" {
37#endif /* __cplusplus */
38
46#define APR_MMAP_READ 1
48#define APR_MMAP_WRITE 2
49
51typedef struct apr_mmap_t apr_mmap_t;
52
62struct apr_mmap_t {
65#ifdef BEOS
68#endif
69#ifdef WIN32
73 void *mv;
78#endif
80 void *mm;
86};
87
88#if APR_HAS_MMAP || defined(DOXYGEN)
89
95#ifdef MMAP_THRESHOLD
96# define APR_MMAP_THRESHOLD MMAP_THRESHOLD
97#else
98# ifdef SUNOS4
99# define APR_MMAP_THRESHOLD (8*1024)
100# else
101# define APR_MMAP_THRESHOLD 1
102# endif /* SUNOS4 */
103#endif /* MMAP_THRESHOLD */
104
108#ifdef MMAP_LIMIT
109# define APR_MMAP_LIMIT MMAP_LIMIT
110#else
111# define APR_MMAP_LIMIT (4*1024*1024)
112#endif /* MMAP_LIMIT */
113
115#define APR_MMAP_CANDIDATE(filelength) \
116 ((filelength >= APR_MMAP_THRESHOLD) && (filelength < APR_MMAP_LIMIT))
117
118/* Function definitions */
119
137
146 apr_pool_t *p);
147
153
162
163#endif /* APR_HAS_MMAP */
164
167#ifdef __cplusplus
168}
169#endif
170
171#endif /* ! APR_MMAP_H */
APR Error Codes.
APR File I/O Handling.
APR memory allocation.
APR Rings.
const char const char apr_int32_t apr_fileperms_t apr_pool_t * cntxt
Definition apr_dbm.h:92
const apr_xml_elem int apr_array_header_t int const char apr_size_t * psize
Definition apr_xml.h:289
const void apr_status_t(*) apr_status_t(* APR_DECLARE)(void) apr_pool_pre_cleanup_register(apr_pool_t *p
Definition apr_pools.h:646
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
const char apr_int32_t flag
apr_seek_where_t apr_off_t * offset
const char apr_file_t * file
apr_sockaddr_t * addr
#define APR_RING_ENTRY(elem)
Definition apr_ring.h:70
apr_pool_t * p
Definition md_event.c:32
apr_size_t size
Definition apr_mmap.h:82
apr_pool_t * cntxt
Definition apr_mmap.h:64
void * mm
Definition apr_mmap.h:80
struct apr_mmap_t::@54 link
typedef HANDLE(WINAPI *apr_winapi_fpt_CreateToolhelp32Snapshot)(DWORD dwFlags