]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
7e2ce386 | 2 | #pragma once |
ddeb4241 | 3 | |
bb66c2e4 YW |
4 | #include <sys/mman.h> /* IWYU pragma: export */ |
5 | ||
0c15577a | 6 | #include "forward.h" |
6da2ea9f | 7 | |
ad62530e TW |
8 | int memfd_create_wrapper(const char *name, unsigned mode); |
9 | ||
4d98709c LP |
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); | |
13 | } | |
14 | ||
6da2ea9f | 15 | int memfd_new_and_seal(const char *name, const void *data, size_t sz) _nonnull_if_nonzero_(2, 3); |
a87a9625 LP |
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); | |
18 | } | |
ddeb4241 | 19 | |
fac9c0d5 DM |
20 | int memfd_set_sealed(int fd); |
21 | int memfd_get_sealed(int fd); | |
ddeb4241 | 22 | |
d54bbc4c | 23 | int memfd_get_size(int fd, uint64_t *ret); |
fac9c0d5 | 24 | int memfd_set_size(int fd, uint64_t sz); |