From 4632777024b7ba210e4efe5cfabc8cd0b5991045 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Mon, 18 Aug 2014 12:24:04 +0200 Subject: [PATCH] memfd: fix memfd_create() syscall wrapper Unlike earlier versions, the syscall only takes 2 arguments in its final version, not 3. --- src/libsystemd/sd-bus/bus-kernel.c | 2 +- src/shared/memfd.c | 2 +- src/shared/missing.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 4156b90..d384f84 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -1121,7 +1121,7 @@ int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *al if (!g) return -ENOMEM; - r = memfd_create(g, 0, MFD_ALLOW_SEALING); + r = memfd_create(g, MFD_ALLOW_SEALING); if (r < 0) return -errno; diff --git a/src/shared/memfd.c b/src/shared/memfd.c index 4dd70a2..dcebfc9 100644 --- a/src/shared/memfd.c +++ b/src/shared/memfd.c @@ -90,7 +90,7 @@ int sd_memfd_new(sd_memfd **m, const char *name) { if (!n) return -ENOMEM; - n->fd = memfd_create(name, 0, MFD_ALLOW_SEALING); + n->fd = memfd_create(name, MFD_ALLOW_SEALING); if (n->fd < 0) { free(n); return -errno; diff --git a/src/shared/missing.h b/src/shared/missing.h index 3a7e67e..3ff1a21 100644 --- a/src/shared/missing.h +++ b/src/shared/missing.h @@ -205,8 +205,8 @@ static inline int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t ma #endif #ifndef HAVE_MEMFD_CREATE -static inline int memfd_create(const char *name, uint64_t size, uint64_t flags) { - return syscall(__NR_memfd_create, name, size, flags); +static inline int memfd_create(const char *name, uint64_t flags) { + return syscall(__NR_memfd_create, name, flags); } #endif -- 2.7.4