aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/include/eina_mmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/eina/src/include/eina_mmap.h')
-rw-r--r--libraries/eina/src/include/eina_mmap.h59
1 files changed, 0 insertions, 59 deletions
diff --git a/libraries/eina/src/include/eina_mmap.h b/libraries/eina/src/include/eina_mmap.h
deleted file mode 100644
index d7e3819..0000000
--- a/libraries/eina/src/include/eina_mmap.h
+++ /dev/null
@@ -1,59 +0,0 @@
1#ifndef EINA_MMAP_H_
2#define EINA_MMAP_H_
3
4/**
5 * @addtogroup Eina_Mmap_Group Mmap Group
6 *
7 * @brief These functions provide helpers for safe mmap handling
8 *
9 * @{
10 *
11 * @since 1.1.0
12 */
13
14/**
15 * @brief Enable or disable safe mmaped IO handling
16 *
17 * @param enabled The enabled state (to enable, pass EINA_TRUE)
18 *
19 * This enables (if possible on your platform) a signal handler for
20 * SIGBUS, that replaces the "bad page" with a pzge of 0's (from /dev/zero)
21 * if a SIGBUS occurs. This allows for safe mmap() of files that may truncate
22 * or from files on devices with IO errors. Normally these cases will result
23 * in a SIGBUS being delivered (and termination of yyour process), but
24 * when "mmap safety" is enabled, this will not occur. Instead a page of
25 * bytes of the value 0 will replace the "bad page", allowing the process
26 * to continue and allow its own parsing error detection to safely abort
27 * the operation without the process falling apart.
28 *
29 * If you disable mmap safety, the SIGBUS handler will be restored to its
30 * default handler. Note that eina_file_map_all() and eina_file_map_new()
31 * will automatically enable mmap safety as they provide an mmaped file IO
32 * layer, and rely on mmap to not fail for any part of the file.
33 *
34 * If you set up your own SIGBUS handler, then this will effectively disable
35 * the safe mmap handling and make you liable to crashes on IO to or from
36 * such "damaged files" that would take down your process.
37 *
38 * @since 1.1.0
39 */
40EAPI Eina_Bool
41eina_mmap_safety_enabled_set(Eina_Bool enabled);
42
43/**
44 * @brief Get the enabled state of mmap safety.
45 *
46 * @return The safety state (EINA_TRUE if enabled)
47 *
48 * This returns the mmap safety state set by eina_mmap_safety_enabled_set().
49 * See eina_mmap_safety_enabled_set() for more information.
50 *
51 * @since 1.1.0
52 */
53EAPI Eina_Bool
54eina_mmap_safety_enabled_get(void);
55
56/**
57 * @}
58 */
59#endif