From e02921db227d7a63a7223b91d10759191a2f7e0b Mon Sep 17 00:00:00 2001 From: ruti <> Date: Wed, 14 Aug 2024 18:48:15 +0300 Subject: [PATCH] Remove flag from memfd_create, remove replacement with tmpfile --- desync.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/desync.c b/desync.c index 8d81f1b..f4a3aba 100644 --- a/desync.c +++ b/desync.c @@ -17,14 +17,8 @@ #include #include #include - - - #ifdef MFD_CLOEXEC - #include - #define memfd_create(name, flags) syscall(__NR_memfd_create, name, flags); - #else - #define memfd_create(name, flags) fileno(tmpfile()) - #endif + #include + #define memfd_create(name, flags) syscall(__NR_memfd_create, name, flags); #endif #else #include @@ -141,7 +135,7 @@ ssize_t send_fake(int sfd, char *buffer, } size_t psz = pkt.size; - int ffd = memfd_create("name", O_RDWR); + int ffd = memfd_create("name", 0); if (ffd < 0) { uniperror("memfd_create"); return -1;