]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/memfd-util.h
befe41ac436e642c8c50c3386abd7b9134436c08
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 #include <sys/mman.h> /* IWYU pragma: export */
8 int memfd_create_wrapper(const char *name
, unsigned mode
);
10 int memfd_new_full(const char *name
, unsigned extra_flags
);
11 static inline int memfd_new(const char *name
) {
12 return memfd_new_full(name
, 0);
15 int memfd_new_and_seal(const char *name
, const void *data
, size_t sz
) _nonnull_if_nonzero_(2, 3);
16 static inline int memfd_new_and_seal_string(const char *name
, const char *s
) {
17 return memfd_new_and_seal(name
, s
, SIZE_MAX
);
20 int memfd_set_sealed(int fd
);
21 int memfd_get_sealed(int fd
);
23 int memfd_get_size(int fd
, uint64_t *ret
);
24 int memfd_set_size(int fd
, uint64_t sz
);