chiark / gitweb /
tree-wide: drop 'This file is part of systemd' blurb
[elogind.git] / src / libelogind / sd-bus / bus-kernel.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   Copyright 2013 Lennart Poettering
6 ***/
7
8 #include "sd-bus.h"
9
10 #define MEMFD_CACHE_MAX 32
11
12 /* When we cache a memfd block for reuse, we will truncate blocks
13  * longer than this in order not to keep too much data around. */
14 #define MEMFD_CACHE_ITEM_SIZE_MAX (128*1024)
15
16 /* This determines at which minimum size we prefer sending memfds over
17  * sending vectors */
18 #define MEMFD_MIN_SIZE (512*1024)
19
20 struct memfd_cache {
21         int fd;
22         void *address;
23         size_t mapped;
24         size_t allocated;
25 };
26
27 #if 0 /// UNNEEDED by elogind
28 #endif // 0
29 void close_and_munmap(int fd, void *address, size_t size);
30 void bus_flush_memfd(sd_bus *bus);
31 #if 0 /// UNNEEDED by elogind
32 #endif // 0