]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd/sd-bus/bus-kernel.h
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / src / libsystemd / sd-bus / bus-kernel.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
6629161f
LP
2#pragma once
3
4/***
6629161f 5 Copyright 2013 Lennart Poettering
6629161f
LP
6***/
7
8#include "sd-bus.h"
9
bc7fd8cd 10#define MEMFD_CACHE_MAX 32
66b26c5c
LP
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. */
832d16a6 14#define MEMFD_CACHE_ITEM_SIZE_MAX (128*1024)
66b26c5c
LP
15
16/* This determines at which minimum size we prefer sending memfds over
17 * sending vectors */
1fa13293 18#define MEMFD_MIN_SIZE (512*1024)
bc7fd8cd
LP
19
20struct memfd_cache {
21 int fd;
22 void *address;
8e959fbf
LP
23 size_t mapped;
24 size_t allocated;
bc7fd8cd
LP
25};
26
a132bef0
ZJS
27void close_and_munmap(int fd, void *address, size_t size);
28void bus_flush_memfd(sd_bus *bus);