diff options
author | Daniel Mack <zonque@gmail.com> | 2014-08-18 13:28:43 +0200 |
---|---|---|
committer | Daniel Mack <zonque@gmail.com> | 2014-08-18 13:32:08 +0200 |
commit | fac9c0d508f72cc5d469c969a4acc3694247c03b (patch) | |
tree | de438cd330880b7b99771780dc82deaecf3f03f6 /src/shared/memfd.h | |
parent | 8a02decaf1e81bad3c06752e998734c96ab11260 (diff) |
memfd: internalize functions, drop sd_memfd type
Remove the sd_ prefix from internal functions and get rid of the sd_memfd
type. As a memfd is now just a native file descriptor, we can get rid of our
own wrapper type, and also use close() and dup() on them directly.
Diffstat (limited to 'src/shared/memfd.h')
-rw-r--r-- | src/shared/memfd.h | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/shared/memfd.h b/src/shared/memfd.h index 452fb508f8..02cb3978fa 100644 --- a/src/shared/memfd.h +++ b/src/shared/memfd.h @@ -27,26 +27,15 @@ #include "macro.h" #include "util.h" -typedef struct sd_memfd sd_memfd; +int memfd_new(int *fd, const char *name); +int memfd_new_and_map(int *fd, const char *name, size_t sz, void **p); -int sd_memfd_new(sd_memfd **m, const char *name); -int sd_memfd_new_from_fd(sd_memfd **m, int fd); -int sd_memfd_new_and_map(sd_memfd **m, const char *name, size_t sz, void **p); +int memfd_map(int fd, uint64_t offset, size_t size, void **p); -void sd_memfd_free(sd_memfd *m); +int memfd_set_sealed(int fd); +int memfd_get_sealed(int fd); -DEFINE_TRIVIAL_CLEANUP_FUNC(sd_memfd*, sd_memfd_free); +int memfd_get_size(int fd, uint64_t *sz); +int memfd_set_size(int fd, uint64_t sz); -int sd_memfd_get_fd(sd_memfd *m); -int sd_memfd_dup_fd(sd_memfd *n); -int sd_memfd_get_file(sd_memfd *m, FILE **f); - -int sd_memfd_map(sd_memfd *m, uint64_t offset, size_t size, void **p); - -int sd_memfd_set_sealed(sd_memfd *m); -int sd_memfd_get_sealed(sd_memfd *m); - -int sd_memfd_get_size(sd_memfd *m, uint64_t *sz); -int sd_memfd_set_size(sd_memfd *m, uint64_t sz); - -int sd_memfd_get_name(sd_memfd *m, char **name); +int memfd_get_name(int fd, char **name); |