Tor
0.4.7.0-alpha-dev
|
Headers for map_anon.c. More...
Go to the source code of this file.
Macros | |
#define | ANONMAP_PRIVATE (1u<<0) |
#define | ANONMAP_NOINHERIT (1u<<1) |
#define | NOINHERIT_CAN_FAIL |
Enumerations | |
enum | inherit_res_t { INHERIT_RES_KEEP =0 , INHERIT_RES_DROP , INHERIT_RES_ZERO } |
Functions | |
void * | tor_mmap_anonymous (size_t sz, unsigned flags, inherit_res_t *inherit_result_out) |
void | tor_munmap_anonymous (void *mapping, size_t sz) |
Headers for map_anon.c.
Definition in file map_anon.h.
#define ANONMAP_NOINHERIT (1u<<1) |
When this flag is specified, try to prevent the mapping from being inherited after a fork(). In some operating systems, trying to access it afterwards will cause its contents to be zero. In others, trying to access it afterwards will cause a crash.
In some operating systems, this flag is not implemented at all.
Definition at line 32 of file map_anon.h.
#define ANONMAP_PRIVATE (1u<<0) |
When this flag is specified, try to prevent the mapping from being swapped or dumped.
In some operating systems, this flag is not implemented.
Definition at line 23 of file map_anon.h.
enum inherit_res_t |
Definition at line 34 of file map_anon.h.
void* tor_mmap_anonymous | ( | size_t | sz, |
unsigned | flags, | ||
inherit_res_t * | inherit_result_out | ||
) |
Return a new anonymous memory mapping that holds sz bytes.
Memory mappings are unlike the results from malloc() in that they are handled separately by the operating system, and as such can have different kernel-level flags set on them.
The "flags" argument may be zero or more of ANONMAP_PRIVATE and ANONMAP_NOINHERIT.
Memory returned from this function must be released with tor_munmap_anonymous().
If inherit_result_out is non-NULL, set it to one of INHERIT_RES_KEEP, INHERIT_RES_DROP, or INHERIT_RES_ZERO, depending on the properties of the returned memory.
[Note: OS people use the word "anonymous" here to mean that the memory isn't associated with any file. This has nothing to do with the kind of anonymity that Tor is trying to provide.]
Definition at line 203 of file map_anon.c.
Referenced by crypto_fast_rng_new_from_seed().
void tor_munmap_anonymous | ( | void * | mapping, |
size_t | sz | ||
) |
Release sz bytes of memory that were previously mapped at mapping by tor_mmap_anonymous().
Definition at line 257 of file map_anon.c.
Referenced by crypto_fast_rng_free_().