1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2012 Lennart Poettering
13 /* One context per object type, plus one of the header, plus one "additional" one */
14 #define MMAP_CACHE_MAX_CONTEXTS 9
16 typedef struct MMapCache MMapCache
;
17 typedef struct MMapFileDescriptor MMapFileDescriptor
;
19 MMapCache
* mmap_cache_new(void);
20 MMapCache
* mmap_cache_ref(MMapCache
*m
);
21 MMapCache
* mmap_cache_unref(MMapCache
*m
);
25 MMapFileDescriptor
*f
,
34 MMapFileDescriptor
* mmap_cache_add_fd(MMapCache
*m
, int fd
);
35 void mmap_cache_free_fd(MMapCache
*m
, MMapFileDescriptor
*f
);
37 unsigned mmap_cache_get_hit(MMapCache
*m
);
38 unsigned mmap_cache_get_missed(MMapCache
*m
);
40 bool mmap_cache_got_sigbus(MMapCache
*m
, MMapFileDescriptor
*f
);