chiark / gitweb /
Prep v235: Apply upstream fixes (5/10) [src/libelogind]
[elogind.git] / src / libelogind / sd-bus / bus-kernel.h
1 #pragma once
2
3 /***
4   This file is part of systemd.
5
6   Copyright 2013 Lennart Poettering
7
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU Lesser General Public License as published by
10   the Free Software Foundation; either version 2.1 of the License, or
11   (at your option) any later version.
12
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   Lesser General Public License for more details.
17
18   You should have received a copy of the GNU Lesser General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include "sd-bus.h"
23
24 #define MEMFD_CACHE_MAX 32
25
26 /* When we cache a memfd block for reuse, we will truncate blocks
27  * longer than this in order not to keep too much data around. */
28 #define MEMFD_CACHE_ITEM_SIZE_MAX (128*1024)
29
30 /* This determines at which minimum size we prefer sending memfds over
31  * sending vectors */
32 #define MEMFD_MIN_SIZE (512*1024)
33
34 struct memfd_cache {
35         int fd;
36         void *address;
37         size_t mapped;
38         size_t allocated;
39 };
40
41 #if 0 /// UNNEEDED by elogind
42 #endif // 0
43 void close_and_munmap(int fd, void *address, size_t size);
44 void bus_flush_memfd(sd_bus *bus);
45
46 uint64_t attach_flags_to_kdbus(uint64_t sd_bus_flags);
47 #if 0 /// UNNEEDED by elogind
48 #endif // 0